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: 

Query regerding Sapscript : Calling abap subroutines

Former Member
0 Kudos

Hello everybody

Hope everyone is doing fine.

I've a small query. Whenever we require to call an abap subroutine from an abap sapscript we do the same using PERFORM statement. The syntax for the same is as below:

PERFORM SUBROUTINE_NAME IN PROGRAM PROGRAM_NAME

USING &VARAIABLE&

CHANGING &VARAIABLE&

ENDPERFORM

Here we are passing the varaiables to the subroutine and getting back values in varaibles. In the actual program we then read values from in_tab and out_tab having structures similar to itcsy.

The above mentioned is as per my understanding. My query is as follows:

If in the above statement instead of passing varaibles abnd getting back variables can be pass/get back an internal table?

I had read somewhere that it is possible using structures. If anyone is aware of how to do the same can you please give me the syntax. Actually how to get value from subroutine into an internal table. What will be the structure? Will it be same as itcsy?

Thanks a lot to everybody in advance.

Thanks & Regards

Kabir Radhakrishnani

2 REPLIES 2

Former Member
0 Kudos

hi check this program!!!

REPORT Z_TEST_VBBE .

types : begin of t_vbap ,

VBELN like vbap-VBELN,

posnr like vbap-posnr,

concat(18),

end of t_vbap.

tables : vbap .

select-options : s_vbeln for vbap-vbeln .

data : it_vbap type table of t_vbap ,

wa_vbap type t_vbap.

select vbeln posnr from vbap into table it_vbap

where vbeln in s_vbeln .

" group by vbeln.

loop at it_vbap into wa_vbap .

perform select_data using wa_vbap-vbeln

wa_vbap-posnr

changing wa_vbap-concat .

modify it_vbap from wa_vbap .

endloop .

*&----


*& Form select_data

*&----


*form select_data using vbeln type vbap-vbeln

  • posnr type vbap-posnr

  • concat.

*

*endform. " select_data

*&----


*& Form select_data

*&----


form select_data using p_wa_vbap_vbeln

p_wa_vbap_posnr

changing p_wa_vbap_concat.

concatenate p_wa_vbap_vbeln

p_wa_vbap_posnr

into p_wa_vbap_concat

separated by '|' .

endform. " select_data

Former Member
0 Kudos

Sorry, i don't think it is possible to pass

in such manner. (ie passing structures or tables)

The system expect Single Fields only. ie. TEXT SYMBOLS

Anyway, if anybody is able to find out, please let us know.

Regards,

Amit Mittal.