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

Regarding insert

former_member242166
Participant
0 Likes
678

HI Friends,

I want select the vendor number ( LFA1-LIFNR) in selection screen. After selecting the vendor number when i execute . I want store the below values into my ztable from vendor master table(LFA1).

The fields are:  LFA1-NAME1,  LFA1-ORTO1, LFA1-STRAS, LFA1-MCOD1 .

I want insert these particular fields into my ztable when i select the particular vendor number..   How can i do please provide the code.   It May be easy.  But i dont know this.. Please help me frnds.

Thanks and Regards,

Linganathan

Moderator Message: Basic question. Thread locked.

Message was edited by: Suhas Saha

4 REPLIES 4
Read only

Former Member
0 Likes
646

Hi,

Use INSERT command. Then F1 for help.

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
646

Read the F1 help of the INSERT/MODIFY statements.Many your threads are faq & basic http://scn.sap.com/people/linganathan.k/content. Try to understand the advice given by Moderators.

Read only

Former Member
0 Likes
646

select-options: s_lifnr for lifnr.

select lifnr name1orto1stras mcod1into table gt_data from lfa1 where lifnr in s_lifnr.

data: gs_custom  type line of 'CUSTOM TABLE',

        ls_data like line of gt_data.

Loop at gt_data into ls_data.

move-corresponding ls_data to gs_custom.

insert 'CUSTOM TABLE' from gs_custom.

ENDLOOP.

Read only

Former Member
0 Likes
646

   ztab-mandt = sy-mandt.

    ztab-name1 = itab-name1.

    ztab-ort01 = itab-ort01.

    ztab-stras = itab-stras.

    INSERT ztab.