I have one scenario in which we have a smartform to print STO invoice output. I want to get supplying and receiving plant address to be printed, but not able to get the logic for the same. In selection screen invoice number is passed.
Sending plant will be there in VBRP-WERKS and Receiving Plant is nothing but Ship-To. Now to get the address of both sending plant and receiving plant, try the below logic
Go to T001W, input the plant code against WERKS and get ADRNR. Next go to VBPA, input that billing document against VBELN, pass SH against PARVW and get ADRNR. Finally, go to ADRC table, pass the above two ADRNR values to ADDRNUMBER to fetch the required address. Ask your ABAP team to apply this logic in the smart form