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

Former Member
0 Likes
213

Hi,

When I am executing this fm getting error as

*Type Items is unknown*

My requireemnt is

when i pass input as pernr to get result in items.

FUNCTION Z_GET_LINEITEMS.

*"----


""Local Interface:

*" IMPORTING

*" REFERENCE(P_PERNR) TYPE PERNR_D

*" EXPORTING

*" REFERENCE(VITEMS) TYPE ZVENDOR_ITEMS

*" TABLES

*" ITEMS STRUCTURE ZVENDOR_ITEMS

*"----


data: v_Stell type stell.

types: begin of h1001_typ,

rsign type rsign,

otype type otype,

subty type subty,

sclas type sclas,

objid type hrobjid,

sobid type sobid, "SOBID

pernr type p_pernr,

objid1 type hrobjid,

end of h1001_typ.

data: h1001_gt type standard table of h1001_typ initial size 0,

wa_h1001 type h1001_typ.

data: WA TYPE ITEMS.

select single stell from pa0001 into v_Stell where pernr = p_pernr and endda ge sy-datum and begda le sy-datum.

check sy-subrc = 0.

select otype sclas objid sobid subty rsign from hrp1001 into corresponding fields of table h1001_gt

where objid = V_stell and endda ge sy-datum and begda le sy-datum.

check sy-subrc = 0.

loop at h1001_gt into wa_h1001.

wa-pernr = p_pernr.

wa = wa_h1001-objid.

wa = wa_h1001-sobid.

append wa to items.

endloop.

ENDFUNCTION.

Thanks,

Asha

1 REPLY 1
Read only

Former Member
0 Likes
189

Thanks