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

HR-ABAP macros avoid

Former Member
0 Likes
1,028

I am new to HR-ABAP

i want to avoid this macro

rp-provide-from-last p0000 space pn-begda pn-endda.

plz send how to write code , with this place.

2. i want to move one internal table fileds to another table

but i do not use move-corresponding ? how plz send code

I am new to HR-ABAP

i want to avoid this macro

rp-provide-from-last p0000 space pn-begda pn-endda.

plz send how to write code , with this place.

2. i want to move one internal table fileds to another table

but i do not use move-corresponding ? how plz send code

6 REPLIES 6
Read only

Shafiq_Rehman1
Active Contributor
0 Likes
981

1. to avoid the macro, here is exact code which works behind that macro.


SORT P0000.
PNP-SW-FOUND = '0'.
CLEAR PNP-SY-TABIX.
LOOP AT P0000.
  IF P0000-BEGDA LE PN-ENDDA AND P0000-ENDDA GE PN-ENDDA.
    PNP-SW-FOUND = '1'.
    EXIT.
  ENDIF.
  IF P0000-BEGDA LE PN-ENDDA AND P0000-ENDDA GE PN-BEGDA.
    PNP-SY-TABIX = SY-TABIX.
  ENDIF.
ENDLOOP.

IF PNP-SW-FOUND EQ '0'.
  IF PNP-SY-TABIX NE 0.
    PNP-SW-FOUND = '1'.
    READ TABLE P0000 INDEX PNP-SY-TABIX.
  ELSE.
    CLEAR P0000.
  ENDIF.
ENDIF.

2. To assign an internal table to another without move coresponding, just copy like this:

it_new[] = it_old[].

Read only

Former Member
0 Likes
981

>

> I am new to HR-ABAP

>

> i want to avoid this macro

> rp-provide-from-last p0000 space pn-begda pn-endda.

>

> plz send how to write code , with this place.

>

> 2. i want to move one internal table fileds to another table

> but i do not use move-corresponding ? how plz send code

for the first one

after the first statment

write as

rp-provide-from-last p0000 space pn-begda pn-endda.

if pn-sw-found = '1'.

reject.

endif.

and let for the second statement u can write as

sujjested above

itab[] = itab1[].

regards

sas

Read only

Former Member
0 Likes
981

srinu

I belive what rehman said is the right way to do

Best Regards

Read only

Former Member
0 Likes
981

CLEAR: G_TABIX.

LOOP AT P0000.

IF P0000-BEGDA <= PN-ENDDA AND P0000-ENDDA >= PN-ENDDA.

EXIT.

ENDIF.

IF P0000-BEGDA <= PN-ENDDA AND P0000-ENDDA >= PN-BEGDA.

G_TABIX = SY-TABIX.

ENDIF.

ENDLOOP.

IF G_TABIX IS NOT INITIAL.

READ TABLE P0000 INDEX G_TABIX.

ELSE.

CLEAR P0000.

ENDIF.

Read only

Former Member
0 Likes
981

Thanks

Read only

Former Member
0 Likes
981

Thanks