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: 

problem in move the data to final internal table.

Former Member
0 Kudos
93

hi,

iam having 3 internal table.

1. g_t_vbrk (having data for vbrk table)

2. g_t_vbak (having data for vbak table)

3. g_t_likp (having data for likp table.)

actually i have written the loop like below .

LOOP AT g_t_vbrk.

READ TABLE g_t_vbfa WITH KEY vbeln = g_t_vbrk-vbeln.

IF sy-subrc = 0.

MOVE : g_t_vbrk-vbeln TO g_t_output_raw_header_data-vbeln,

g_t_vbrk-taxk1 TO g_t_output_raw_header_data-taxk1,

g_t_vbrk-taxk4 TO g_t_output_raw_header_data-taxk4,

g_t_vbrk-fkart TO g_t_output_raw_header_data-fkart,

g_t_vbrk-inco1 TO g_t_output_raw_header_data-inco1,

g_t_vbrk-inco2 TO g_t_output_raw_header_data-inco2,

g_t_vbrk-zterm TO g_t_output_raw_header_data-zterm,

g_t_vbrk-kunag TO g_t_output_raw_header_data-kunag.

READ TABLE g_t_vbak WITH KEY vbeln = g_t_vbfa-vbelv.

IF sy-subrc = 0.

MOVE : g_t_vbak-vkorg TO g_t_output_raw_header_data-vkorg,

g_t_vbak-auart TO g_t_output_raw_header_data-auart,

g_t_vbak-spart TO g_t_output_raw_header_data-spart,

g_t_vbak-vtweg TO g_t_output_raw_header_data-vtweg.

ENDIF.

APPEND g_t_output_raw_header_data.

endloop.

my question is i want to move likp table lfdat field to that final internal table with same loop.

i want to write move statement with same loop.

pls help with coding wise.

thanks

santhosh

1 ACCEPTED SOLUTION

Former Member
0 Kudos
67

Hi

There is no direct relationship between VBRK and LIKP.

You can select the preceding docuemnt number from VBFA by using G_I_VBRK-VBELN; then with the resultant you can READ from the LIKP internal table.

Regards

Surya.

8 REPLIES 8

Former Member
0 Kudos
67

hi,

i want to that 3 internal table data to final internal table.

pls help me as coding wise.

thanks,

santhosh

Former Member
0 Kudos
68

Hi

There is no direct relationship between VBRK and LIKP.

You can select the preceding docuemnt number from VBFA by using G_I_VBRK-VBELN; then with the resultant you can READ from the LIKP internal table.

Regards

Surya.

0 Kudos
67

hi surya,

give some coding wise, please iam waiting for your reply..

thanks,

santhosh.

0 Kudos
67

Hi

In the loop.

SELECT VBELN FROM VBFA

INTO V_VBELN

WHERE VBELV = G_I_VBRK-VBELN

AND VBTYP_N = 'M'

AND VBTYP_V = 'J'.

Now READ from your LIKP internal table.

READ TABLE G_I_LIKP WITH KEY VBELN = V_VBELN.

Write your MOVE statements here.

Regards

Surya.

0 Kudos
67

hi all,

still iam not getting the solution. pls help me.......

thanks,

santhosh

0 Kudos
67

Hi,

What you can do is loop over one table and then in each loop pass READ from the other tables based on KEY or INDEX and then insert the data into a workarea of type of your final internal table then do APPEND to final internal table.

Regards,

Sesh

Former Member
0 Kudos
67

I think u need to use the table read table G_T_VBFA with key vbeln and VBTYP_N or VBTYP_V as 'J' this is for delivery and then read the corresponding document for this in VBFA and then move that record in final table as per the sales order number in VBAK.

If u dont get I can gve u in the coding please let me know

0 Kudos
67

hi Abhay Chauhan ,

i con understand. give the coading for that

thanks

santhosh