Extracting Script Number from a PO in ME21N
I have a requirement of saving a PO as a pdf locally while it is created and being saved, i used the BADI ME_PURCHDOC_POSTED and method POSTED to achieve this.
But when i open the PDF , i find that it saves the PO which was created earlier. Like for example PO421 is saved while 422 is created, This is due to the spool number in TSP01 is not updated till this save action is over. so it is picking up the last spool no and converting it into PDF.
I need to eliminate this and i need to know if i can find a spool no before it is updated in TSP01 or is their any other BADI which runs right immediately after the save option so that i can take the latest spool no.
All suggestions are greatly appreciated and rewarded.