Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

data in sapscript

Former Member
0 Kudos

i wrote : &vbap-xblnr&

what i need to do to get this value without going out

to se38 ang select the value.

6 REPLIES 6

former_member181962
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

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

abdul_hakim
Active Contributor
0 Kudos

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

former_member188685
Active Contributor
0 Kudos
/:   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.

Former Member
0 Kudos

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.