Skip to Content
author's profile photo Former Member
Former Member

regarding (enhancement M06E0004, EXIT_SAPLEBND_002)

Hi All,

This is regarding (enhancement M06E0004, EXIT_SAPLEBND_002,

for p.o release strategy. All I am trying is that relese should get reset as it gets in case of change of po quantity, also for change in the delivery date. Though I have soled the problem on my own temporarily however need ur comment and if possible a better solution.

Am not sure if this is the best solution and its effects.

I didnt make any new characteristics in ct04, for the delivery date since i didn't want to restrict the delivery date. All I did is in the coding below in the exit :

DATA wa_eket TYPE LINE OF mmpur_beket.

DATA wa_eket1 TYPE LINE OF mmpur_beket.

data: c type i.

data: p type i.

break1.

break2.

e_cekko = i_cekko.

loop at it_beket into wa_eket . " for comparing previous and the current del date

e_cekko-usrc1 = wa_eket-eindt.

SELECT SINGLE * FROM eket INTO wa_eket1 WHERE ebeln = wa_eket-ebeln

AND ebelp = wa_eket-ebelp.

if wa_eket1-eindt <> wa_eket-eindt.

import c from memory id 'CID'.

c = c + 1.

clear p.

p = c mod 2.

if p is not initial. " adding 0.01 to the characteristic value for p.o amt.

e_cekko-GNETW = e_cekko-GNETW + '0.01'.

else.

e_cekko-GNETW = e_cekko-GNETW - '0.01'.

export c to memory id 'CID'.

endif.

endif.

endloop.

********************************************************

The logic I tried using is since the relese gets reset incase of p.o amnt and hence indirectly po amnt so i changed the value of p.o value by 0.01 incase of change in delivery date. cekok-gnetw doesnt reflect anywhere in the p.o as amnt, I guess its for defing range for relese stragey's amont in ct04 characteristics.

However anything better incase u know plz let me know, or do u think this can cause any problems later....new to exits.

Rgds,

Anu.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 31, 2007 at 12:05 PM

    Hi Anu,

    I had go through u r code.

    <b>point 1.</b>One thing i want to mention here is u r selecting the EKET data based on the EBELN and EBELP... but u should consider the ETENR in to consideration.. beacuse u r comparing the data in wa_eket with the entry in data base table.. but every time it retrieve teh Frist record from data base, so the process fails..<b> u r select query is not considering ETENT while u have ETENR in wa_eket.</b>

    loop at it_beket into wa_eket . " for comparing previous and the current del date
    e_cekko-usrc1 = wa_eket-eindt.
    SELECT SINGLE * FROM eket INTO wa_eket1 WHERE ebeln = wa_eket-ebeln
    AND ebelp = wa_eket-ebelp.

    point.no. 2 u have written u select inside the loop... So for every record in table it_beket -->goes to the data base...it kills the performande instead u can retrieve the data first using the FOR ALL ENTRIES.. then use READ inside the loop. and u r retrieving all the field which are not required. select only fields only u want to use.

    <b>i have modifield u r code.. pasting here... once go through this.. it imroves the performance.</b>

    TYPES: BEGIN OF ty_eket,
          ebeln type ebeln,
          ebelp type ebelp,
          etenr type eeten,
          eindt type eindt,
          end of ty_eket,
    
          ty_t_eket type standard table of ty_eket.
    
    
    DATA: wa_eket  TYPE LINE OF mmpur_beket,
          it_eket1 TYPE ty_t_eket,
          wa_eket1 TYPE ty_eket,
          c TYPE i,
          p TYPE i.
    
    *select the DATa from EKET
    SELECT ebeln
           ebelp
           etenr
           eindt
      FROM eket
      INTO TABLE it_eket1
       FOR ALL ENTRIES IN it_beket
      WHERE ebeln = it_beket-ebeln AND
            ebelp = it_beket-ebelp AND
            etenr = it_beket-etenr.
    IF sy-subrc = 0.
      SORT it_eket1 BY ebeln ebelp etenr.
    ENDIF.
    
    e_cekko = i_cekko.
    
    
    LOOP AT it_beket INTO wa_eket ."for comparing previous and the current
    *  del date
     e_cekko-usrc1 = wa_eket-eindt.
    *  SELECT SINGLE * FROM eket INTO wa_eket1 WHERE ebeln = wa_eket-ebeln
    *  AND ebelp = wa_eket-ebelp.
      READ TABLE it_eket1 INTO wa_eket1
                  WITH KEY ebeln = wa_eket-ebeln
                           ebelp = wa_eket-ebelp
                           etenr = wa_eket-etenr
                           binary search.
      IF sy-subrc = 0 AND wa_eket1-eindt <> wa_eket-eindt.
    
    *  IF wa_eket1-eindt <> wa_eket-eindt.
        IMPORT c FROM MEMORY ID 'CID'.
        c = c + 1.
        CLEAR p.
        p = c MOD 2.
    
      IF p IS NOT INITIAL. " adding 0.01 to the characteristic value for p.o
    *      amt.
          e_cekko-gnetw = e_cekko-gnetw + '0.01'.
        ELSE.
          e_cekko-gnetw = e_cekko-gnetw - '0.01'.
          EXPORT c TO MEMORY ID 'CID'.
    
        ENDIF.
      ENDIF.
    ENDLOOP.

    <b>Let me know if have any Clarification</b>

    Please Close this thread.. when u r problem is solved

    Reward if Helpful

    Regards

    Naresh Reddy K

    Message was edited by:

    Naresh Reddy

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 31, 2011 at 11:52 PM

    Thanks to all,

    Anupma Chandra.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      I have the same requirement, I had written the code in exit "EXIT_SAPLEBND_002" but problem is this exit is not getting triggered when I am saving data in tcode ME22n.

      Can you please help in how to trigger this exit.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.