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

Changed fields from CDHDR & CDPOS..

Former Member
0 Likes
406

Hi,

I need a logic for the Asset changes in the Final output.

I am able to capture the last change from CDHDR & CDPOS tables, but my requirement is i need to capture all the changes to the particular asset and to display as a separate row with the changed date and value(if 3 changes then 3 rows to be appended to the internal table).

The previous changed value will be in CDPOS-VALUE_OLD, But i need to display below or above the new changed value with the changed date. so can any one send me a sample program for this, Its Urgent....

Points will be awarded.

LOOP AT it_ane ASSIGNING <fs_ane1>.

CONCATENATE <fs_ane1>-bukrs <fs_ane1>-anln1 <fs_ane1>-anln2 INTO v_objectid1.

IF <fs_ane1>-budat IN s_budat.

CLEAR : wa_bna, wa_cdpos, wa_cdhdr, wa_objectid.

MOVE-CORRESPONDING <fs_ane1> TO wa_bna. "#EC ENHOK

IF sy-subrc EQ 0.

READ TABLE it_objectid INTO wa_objectid WITH KEY objectid = v_objectid1."#EC *

READ TABLE it_cdhdr INTO wa_cdhdr WITH KEY objectid = wa_objectid-objectid.

READ TABLE it_cdpos INTO wa_cdpos WITH KEY changenr = wa_cdhdr-changenr.

IF wa_cdpos IS NOT INITIAL.

wa_bna-txjcd = wa_cdpos-value_new.

ENDIF.

IF sy-subrc EQ 0.

wa_bna-budat = wa_cdhdr-udate.

wa_bna-ttext = text-036. "Jurisdiction Code Changed

wa_bna-anbtr = space.

wa_bna-pbukr = space.

wa_bna-ndjar = space.

wa_bna-ndper = space.

ENDIF.

ENDIF.

ENDIF.

IF sy-subrc EQ 0.

APPEND wa_bna TO it_bna.

ENDIF.

ENDLOOP.

Thanks & Regards,

Ramana

1 REPLY 1
Read only

former_member156446
Active Contributor
0 Likes
323

append using index.. or sy-index+1