Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

where to do the abap sql statement in sapscript (PO)

Hi, all.

Hope anybody can guide me to find a solution.

My situation now is i have to do a purchase order in SAPSCRIPT starting from a standard po. I already found out all the related details as below:

Program SAPFM06P



So, now the problem now is I have to add some more data on my print out PO. After figure out for some time, I don't know where to do my abap sql statement. Like example, I want to retriece some data from the ADRC table. I opened the standard program SAPFM06P to add in the some sql statement, but i dun know where should i add in. Bcz if we straight away put the related ADRC field in our sapscript, it is useless, right?

Thanks in advance.

Former Member

You can create a separate program where you put all the FORM subroutines you need. Suppose that program is called Z_SCRP_FORMS, you would place this coding in the SAPscript window:


Then, in the program Z_SCRP_FORMS this should be the coding:


          TABLES    in_tab STRUCTURE itcsy
                           out_tab STRUCTURE itcsy.

" Inside the IN_TAB there's an entry which VALUE field has the value from variable IN_PAR1 (and the NAME field has 'IN_PAR1' as contents), you take it using READ statement.
" Similarly, in OUT_TAB there's an entry in which VALUE field you must put the value you want for variable OUT_PAR1, which you do by READ and MODIFY over the table.


This form could be put on the standard program in case it was copied to a Z program, otherwise there's no point in modifying the standard.

Edited by: Alejandro Bindi on Sep 14, 2008 10:13 PM

0 View this answer in context

Helpful Answer

Not what you were looking for? View more on this topic or Ask a question