Application Development and Automation 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: 
Read only

Read internal table of diff program in another program.

Former Member
0 Likes
1,014

Hi,

I have written the following code in BADI.

types: tp_t_drseg type standard table of drseg initial size 0.

FIELD-SYMBOLS : <y_it_drsego> TYPE tp_t_drseg.

  • <y_it_drseg> type ANY.

DATA: y_it_drseg(40) type c,

y_lv_it_drseg type standard table of drseg,

wa_y_lv_it_drseg type drseg.

..

..

y_it_drseg = '(SAPLMRMP)T_DRSEG[]'.

ASSIGN (y_it_drseg) to <y_it_drsego>.

If sy-subrc eq 0.

--- Statements.

Endif.

But here the value of sy-subrc = 4.

I tried with

y_it_drseg = '(SAPLMRMP)T_DRSEG'.

ASSIGN (y_it_drseg) to <y_it_drsego>.

For structure it is working fine. But for internal table it is returning 4. Your help will be appreciated.

Thanks and regards

Santosh

3 REPLIES 3
Read only

Former Member
0 Likes
497

Hi Santosh,

You need to EXPORT the internal table from another program & IMPORT the same in your program.

In ANother program.

EXPORT ITAB TO MEMORY ID 'ZID'.

In Your program

IMPORT ITAB FROM MEMORY ID 'ZID'.

Best regards,

Prashant

Read only

0 Likes
497

Hi Prashan,

Thanks for reply. As the program SAPLMRMP is standard program I am avoiding to modify it as it requires access key. Because of this I am writing this code in BADI to change the value of T_DRSEG table. Please let me know whether it is possible by using field-symbol or not or is there any other method.

Read only

Former Member
0 Likes
497

replace your below statement:

FIELD-SYMBOLS : <y_it_drsego> TYPE tp_t_drseg.

with

FIELD-SYMBOLS : <y_it_drsego> TYPE TABLE.

Cheers