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

Data insertion

Former Member
0 Likes
331

I have written a inner join on mchb and mara but the values are not matching on matnr so i need to insert the data into mara-matnr from program, how can i do this i need code.

2 REPLIES 2
Read only

Former Member
0 Likes
306

Hi,

try this out.

SELECT matnr werks lgort

FROM mard INTO TABLE git_mard

WHERE werks EQ p_werks AND

lgort EQ p_lgort AND

labst GT gc_labst.

  • if the internal table is not initial then select the required fields

  • into an internal table

IF git_mard IS NOT INITIAL.

SELECT matnr werks lgort charg clabs

FROM mchb INTO TABLE git_mchb

FOR ALL ENTRIES IN git_mard

WHERE matnr EQ git_mard-matnr AND

werks EQ git_mard-werks AND

lgort EQ git_mard-lgort AND

lvorm EQ gc_null.

ENDIF.

IF git_mchb IS NOT INITIAL.

SELECT matnr meins FROM mara

INTO TABLE git_mara

FOR ALL ENTRIES IN git_mchb

WHERE matnr EQ git_mchb-matnr.

ENDIF.

Read only

Former Member
0 Likes
306

My own