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

Using Provide-endprovide copy internal table

Former Member
0 Likes
1,015

Hi,

I have problem that is if i want to copy the data from infotype to internal table means

Provide * from p9012 between pn-begda and pn-endda.

if p9012-zz_client_c EQ itemp-z_client_c.

MOVE: p9012-begda TO it9012-begda,

p9012-zz_dept_c TO it9012-z_dept_c,

SORT IT9012 BY z_dept_c.

append it9012.

endif.

endprovide.

this one not copying data from infotype to internaltable.

what i can do?

Thanks,

Regards,

Nandha

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
967

Hi,

i didn't use if condition means it's populated.If i use if condition.i am not getting any data.

Nandha

Hi,

i didn't use if condition means it's populated.If i use if condition.i am not getting any data.

Nandha

7 REPLIES 7
Read only

Former Member
0 Likes
967

Pls check this once -

MOVE: p9012-begda TO it9012-begda,

p9012-zz_dept_c TO it9012-z_dept_c,

SORT IT9012 BY z_dept_c.

append it9012.

In above code you have sort before Append. This can cause the problem. Can you first append entry and then sort.

Read only

Former Member
0 Likes
967

HI Use this code example..

plz reward poins if it helps you..

&----


& Report ZSAPHR_PNP

*& *

&----


*& *

*& *

&----


Report ZSAPHR_PNP.

TABLES : PERNR.

*Infotype Declaration

INFOTYPES: 0002, "PERSONAL DATA

0006, "ADDRESS

0008, "

0000, "

0001. "ACTIONS

DATA : BEGIN OF ITAB OCCURS 10, "INTERNAL TABLE DECLARATION

NACHN LIKE P0002-NACHN,

VORNA LIKE P0002-VORNA,

GESCH LIKE P0002-GESCH,

GBDAT LIKE P0002-GBDAT,

FAMST LIKE P0002-FAMST,

HSNMR LIKE P0006-HSNMR,

STRAS LIKE P0006-STRAS,

LOCAT LIKE P0006-LOCAT,

PSTLZ LIKE P0006-PSTLZ,

LAND1 LIKE P0006-LAND1,

PLANS LIKE P0001-PLANS,

ORGEH LIKE P0001-ORGEH,

BET01 LIKE P0008-BET01,

WAERS LIKE P0008-WAERS,

PERNR LIKE P0000-PERNR,

END OF ITAB.

DATA: G_REPID LIKE SY-REPID."Report name

INITIALIZATION.

G_REPID = SY-REPID.

PNPTIMED = 'D'.

**********************************************START OF

SELECTION*****************************************

START-OF-SELECTION.

GET PERNR.

PROVIDE * FROM P0002 BETWEEN PN-BEGDA AND PN-ENDDA.

ITAB-PERNR = P0000-PERNR.

ITAB-NACHN = P0002-NACHN.

ITAB-VORNA = P0002-VORNA.

IF P0002-FAMST = '0'.

ITAB-FAMST = 'S'.

ELSE.

ITAB-FAMST = 'M'.

ENDIF.

ITAB-FAMST = P0002-FAMST.

IF P0002-GESCH = '1'.

ITAB-GESCH = 'M'.

ELSE.

ITAB-GESCH = 'F'.

ENDIF.

ITAB-GBDAT = P0002-GBDAT.

ITAB-HSNMR = P0006-HSNMR.

ITAB-STRAS = P0006-STRAS.

ITAB-LOCAT = P0006-LOCAT.

ITAB-PSTLZ = P0006-PSTLZ.

ITAB-LAND1 = P0006-LAND1.

ITAB-ORGEH = P0001-ORGEH.

ITAB-PLANS = P0001-PLANS.

ITAB-BET01 = P0008-BET01.

ITAB-WAERS = P0008-WAERS.

APPEND ITAB.

ENDPROVIDE.

END-OF-SELECTION.

Read only

Former Member
0 Likes
967

No it's not yet solved

Regards

Nandha

Read only

0 Likes
967

Have you checked in debug mode if there is any value getting populated?

Read only

Former Member
0 Likes
968

Hi,

i didn't use if condition means it's populated.If i use if condition.i am not getting any data.

Nandha

Read only

0 Likes
967

Check in debug for if p9012-zz_client_c and itemp-z_client_c values. Also have you moved sort after append?

Try this once. I feel the IF condition is not getting satsified. Pls check once.

Read only

0 Likes
967

Hi,

Yes solved

Thanks,

Regards,

Nandha