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

Set Deleteindicator on Purchasing Info Record

Former Member
0 Likes
3,468

Hi guys,

i need to set the delete indicator on a purchase inforecord. I have tried to test with function module ME_UPDATE_INFORECORD. But I cannot get the indicator set.

Could any of you please expaline, how to use the function module, or advise an other way to do this.

Kind regards

Mikkel

1 ACCEPTED SOLUTION
Read only

Former Member
2,121

Try the below example code.



DATA: it_eina TYPE STANDARD TABLE OF eina WITH HEADER LINE,
      it_eine TYPE STANDARD TABLE OF eine WITH HEADER LINE.

SELECT * FROM eina INTO TABLE it_eina WHERE infnr = '5300000042'.
IF sy-subrc = 0.
  SELECT * FROM eine INTO TABLE it_eine WHERE infnr = '5300000042'.
ENDIF.

DATA: lt_eina TYPE eina,
      lt_eina1 TYPE eina,
      lt_eine TYPE eine.

LOOP AT it_eina.
  LOOP AT it_eine WHERE infnr = it_eina-infnr.
    LT_eina = it_eina.
    LT_eina1 = it_eina.
    LT_eine = it_eine.
"IT_EINA-LOEKZ will be updated with 'X' and not for LT_EINA-LOEKZ
    it_eina-loekz = 'X'.     
"IT_EINE-LOEKZ will be updated with 'X' and not for LT_EINE-LOEKZ
    it_eine-loekz = 'X'.
"XEINA and YEINA will contain same values for all fields except for the fields to be 
"updated.
"XEINE and YEINE will contain same values for all fields except for the fields to be 
"updated.
    CALL FUNCTION 'ME_UPDATE_INFORECORD'
      EXPORTING
        xeina    = it_eina
        xeine    = it_eine
        yeina    = lt_eina
        yeine    = lt_eine
        reg_eina = lt_eina1.
  ENDLOOP.
ENDLOOP.

Hope this helps.

Thanks,

Balaji

Hi guys,

i need to set the delete indicator on a purchase inforecord. I have tried to test with function module ME_UPDATE_INFORECORD. But I cannot get the indicator set.

Could any of you please expaline, how to use the function module, or advise an other way to do this.

Kind regards

Mikkel

7 REPLIES 7
Read only

narendar_naidu
Active Participant
0 Likes
2,121

hi,

this can be done using BDC call transaction method ,

first record the tcode and then using perform statements u can assign a delete, block and unblock indicator.

while recording in menu path u will find the delete indicator.

<REMOVED BY MODERATOR>

Narendar.

Edited by: Alvaro Tejada Galindo on Feb 25, 2008 5:44 PM

Read only

Former Member
0 Likes
2,121

Please record the transaction ME15 to delete the info record. and write a BDC program to do the acutal deletion (Flag).

Thanks,

Read only

Former Member
0 Likes
2,121

HI,

Under Deletion Flags, there are 2 categories:

a) Complete Info record : EINA-LOEKZ

b) Purch Org data : EINE-LOEKZ

Pls set both these fields as required to 'X' while passing as a import parameter to the FM. This should work.

After the Fm executes also give a COMMIT WORK.

<REMOVED BY MODERATOR>

Regards,

JLN

Edited by: Alvaro Tejada Galindo on Feb 25, 2008 5:45 PM

Read only

Former Member
0 Likes
2,121

Try using ME15 transaction to delete the Info record. This would be quite easy compared to usinng FM ME_UPDATE_INFORECORD.

Thanks,

Balaji

Read only

narendar_naidu
Active Participant
0 Likes
2,121

hi mikkel,

if this issue is resolved plz put the code in the thread.

regards narendar.

Read only

Former Member
2,122

Try the below example code.



DATA: it_eina TYPE STANDARD TABLE OF eina WITH HEADER LINE,
      it_eine TYPE STANDARD TABLE OF eine WITH HEADER LINE.

SELECT * FROM eina INTO TABLE it_eina WHERE infnr = '5300000042'.
IF sy-subrc = 0.
  SELECT * FROM eine INTO TABLE it_eine WHERE infnr = '5300000042'.
ENDIF.

DATA: lt_eina TYPE eina,
      lt_eina1 TYPE eina,
      lt_eine TYPE eine.

LOOP AT it_eina.
  LOOP AT it_eine WHERE infnr = it_eina-infnr.
    LT_eina = it_eina.
    LT_eina1 = it_eina.
    LT_eine = it_eine.
"IT_EINA-LOEKZ will be updated with 'X' and not for LT_EINA-LOEKZ
    it_eina-loekz = 'X'.     
"IT_EINE-LOEKZ will be updated with 'X' and not for LT_EINE-LOEKZ
    it_eine-loekz = 'X'.
"XEINA and YEINA will contain same values for all fields except for the fields to be 
"updated.
"XEINE and YEINE will contain same values for all fields except for the fields to be 
"updated.
    CALL FUNCTION 'ME_UPDATE_INFORECORD'
      EXPORTING
        xeina    = it_eina
        xeine    = it_eine
        yeina    = lt_eina
        yeine    = lt_eine
        reg_eina = lt_eina1.
  ENDLOOP.
ENDLOOP.

Hope this helps.

Thanks,

Balaji

Read only

Former Member
0 Likes
2,121

Thank you all, this solved my problem.

Kind regards

Mikkel