cancel
Showing results for 
Search instead for 
Did you mean: 

sapscript - internal table

Former Member
0 Kudos

Hi,

I'm working on sapscript which I copied from standard form SD_EXPORT_FEEU. In my requirement, I need to display every items from VBRP table in the main window but in the standard form, all these items are not displayed. This means I need to create a Z subroutine to add all additional items. But the problem is, I couldn't send back the internal table (which contain rows of items from VBRP table) to sapscript. In addition, I tried to use write_form in my subroutine but it's just not working. I guess this is not allowed as I'm using the standard form. Is there any other way to do this?

Any helps is very much appreciated.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks for prompt response.

This is the scenario - since I'm using the standard form (and I'm not allowed to change the standard program that call this standard form), therefore I create a subroutine program in order to use a write_form approcah. So what I did is as following:

  • My sapscript

Perform GET_ITEM in Z_****

USING &GW_***&

ENDPERFORM

  • My Subroutine

form get_item

loop at itab

write_form

endloop.

endform.

You see, I call the GET_ITEM subroutine from my sapscript, and inside the GET_ITEM subroutine, I use the write_form to send the required data. But then, this is not working coz I guess I'm not supposed to use write_form in my subroutine because it can only be called from the standard program.

Any ideas how to solve this?

Thanks in advance.

Former Member
0 Kudos

hi,

whn u r callin this perform u have to mention the program name

Perform GET_ITEM <b>in Program</b> Z_****

USING &GW_***&

ENDPERFORM

and one more thisn put a break poin thin subroutine and check whether the values are populating.

i thnink these perform is used to pass the value to the varibles u r using but not for callin ths write_form.

can u paste the complete form declaration..

normally u ahve to difine this using the ITCSY.

Former Member
0 Kudos

hi welcome to SDN,

u can achive this using the external subrotiens in SCRIPT.

for this u in the text editor u have to call the perform and pass this table in it and write from difination in another include program if u have not copied the standard program.

for this write like this the window text editor

/: PERFORM <function> IN PROGRAM <progr> 
USING &val1&
USING &CONSTANT_VALUE& 
CHANGING &SNAME& 
ENDPERFORM.

once look at these threads

h_senden2
Active Contributor
0 Kudos

Hi,

you should not send back the whole internal table !

What you normally will do is :

loop at ITAB.

call 'WRITE_FORM' .......

"for one record

endloop.

regards,

Hans

Please reward all helpful answers !!!!!