‎2006 Jan 17 12:03 PM
i wrote : &vbap-xblnr&
what i need to do to get this value without going out
to se38 ang select the value.
‎2006 Jan 17 12:10 PM
One option is to use Perform statement in the text elements and write your select in that form.
Perform <formname> using &variable&.
in another include, write the logic to retrieve data in between
form endform
use itcsy structure for formal parameters.
‎2006 Jan 17 12:13 PM
u need to c that the variable vbap-xblnr has some value before ur program calls the script ( Write_Form ). any variable u use in sapscript comes from the associated Print Program n if its unable to detect the variable, it generates errors which u can c via Check-->Texts in SApscript.
Regards,
Bikash
‎2006 Jan 17 12:16 PM
hi,
in one of the ABAP program you have to fetch XBLNR value from VBAP.
either you can do in driver program
or use PERFORM in the script & fetch that value.
example for 2nd way :
perform fetch_xblnr in program <some z_program>
using &vbap-vbeln&
changing &vbap-xblnr&.
in the program, you have to write :
FORM fetch_xblnr TABLES itab STRUCTURE itcsy
otab STRUCTURE itcsy.
HERE
CLEAR v_vbeln.
READ TABLE itab WITH KEY name = 'vbap-vbeln'
TRANSPORTING value.
v_vbeln = itab-value.
now you will have VBELN VALUE, THen use select statement to fetch XBLNR value for that VBELN.
after that
otab-value = v_xblnr.
MODIFY otab TRANSPORTING value WHERE name = 'vbap-xblnr'.
ENDFORM.
now in your script this XBLNR will be populated in VBAP-xblnr.
regards
srikanth
Message was edited by: Srikanth Kidambi
‎2006 Jan 17 12:25 PM
Hi Liat
Just loop througth the internal table in WRITE_FORM.
For eg.
LOOP AT ITAB.
WRITE_FORM
ENDLOOP
Replace &vbap-xblnr& with &itab-xblnr&
Abdul
‎2006 Jan 17 12:37 PM
/: PERFORM GET_XBLNR IN PROGRAM ZGET_XBLNR
/: USING &VBAP-VBELN&
/: CHANGING &XBLNR&
/: ENDPERFORM
REPORT zget_XBLNR .
FORM get_units TABLES in_tab STRUCTURE itcsy out_tab STRUCTURE itcsy."select the XBLNR based on VBELN
ENDFORM.
‎2006 Jan 20 5:59 AM
hi
PERFORM statement can be used to call the subroutines from any program.
The system does not execute the PERFORM command within SAPscript replace modules, such as TEXT_SYMBOL_REPLACE or TEXT_INCLUDE_REPLACE.
syntax.
/:perform <form> in program <prog>
/: using &-----&
...............
changing &----&
......................
/:endperform
this abap subroutine program called via the command line above should be defined in the ABAP program as
FORM <form> TABLES IN_TAB STRUCTURE ITCSY
OUT_TAB STRUCTURE ITCSY.
...
ENDFORM.
so now the values of the sap script symbols passed with /:using are stored in the internal table u have created IN_TAB.
if u want to have a clear idea about it plz visit http://help.sap.com.
regards
selvi.