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

Function module in ABAP

Former Member
0 Likes
320

I want to create a funcion module which inserts data in a table i created sooner.

This is how my table looks in se11:

[pic01|http://kepfeltolto.hu/i/?90028&t=img]

This is how my import tab looks within the function module:[pic02|http://kepfeltolto.hu/i/?90031&t=img]

This is my source code in the modul:

FUNCTION ZPB01FM.

IMPORTING

REFERENCE(OUAID) TYPE INT1

REFERENCE(COMP) TYPE SSTRING

REFERENCE(BUSINESS) TYPE SSTRING

REFERENCE(GROUP) TYPE SSTRING

REFERENCE(NAMEOF) TYPE SSTRING

REFERENCE(MANNAME) TYPE SSTRING

*"----


DATA: itab TYPE TABLE OF ZPB_FORM_ORG

wa LIKE LINE OF itab.

wa-ORG_UAID = OUAID.

wa-company = comp.

wa-business_area = business.

wa-group_zpb = group.

wa-name_of_nou = nameof.

wa-manager_name = manname.

INSERT wa INTO TABLE ZPB_FORM_ORG.

ENDFUNCTION.

I did not change anything else in function modul. Will this work? If not how should i do it?

If it works is it not a problem, that i don't insert all fields in table, only 5 of them?

I really need the answer, thanks, Peter

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
297

Yes, the other fields will simply be blank, but your INSERT statement isn't right. I don't think that will pass a syntax check. You might want to do this instead.

INSERT ZPB_FORM_ORG from wa.

Regards,

Rich Heilman

1 REPLY 1
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
298

Yes, the other fields will simply be blank, but your INSERT statement isn't right. I don't think that will pass a syntax check. You might want to do this instead.

INSERT ZPB_FORM_ORG from wa.

Regards,

Rich Heilman