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

Modification of code - assistance required

Hi All,

In the below mentioned code the quantity is read from EKPO-MENGE field & the open qty field is calculated by subtracting EKPO-MENGE from EKBE-MENGE.

I want to modify this code to read the quantity from EKET-MENGE & the Open qty field should subtract EKET-MENGE from EKES-MENGE. I need to keep in mind that EKET table can have multiple delivery schedule lines per PO line. So when i subtract the quantity coming from EKES table, it has to subtract starting from delivery schedule line 1 & move to the next line.

Hope my question is clear, await inputs....

Code:

TYPES :

BEGIN OF TL_EKBE,

SHKZG TYPE EKBE-SHKZG,

MENGE TYPE EKBE-MENGE,

END OF TL_EKBE.

DATA :

IL_EKBE TYPE TABLE OF TL_EKBE,

HL_EKBE TYPE TL_EKBE.

REFRESH :

IL_EKBE[].

CLEAR :

HL_EKBE,

OPEN_QUANTITY.

*Open quantity

OPEN_QUANTITY = EKPO-MENGE.

SELECT SHKZG MENGE INTO TABLE IL_EKBE[]

FROM EKBE

WHERE EBELN EQ EKKO-EBELN

AND EBELP EQ EKPO-EBELP.

IF SY-SUBRC EQ 0.

LOOP AT IL_EKBE[] INTO HL_EKBE.

CASE HL_EKBE-SHKZG.

WHEN 'S'.

SUBTRACT HL_EKBE-MENGE FROM OPEN_QUANTITY.

WHEN 'H'.

ADD HL_EKBE-MENGE TO OPEN_QUANTITY.

ENDCASE.

ENDLOOP.

ENDIF.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 25, 2007 at 05:51 AM

    What is your requirement according to the spec?.

    Then Paste your code, it will be useful to understand better.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Mr. Baburaj,

      I still believe there is a bug in the program,

      Eg: Shipping notification qty is 2 (EKES-MENGE = 2)

      1. IF wa_eket-menge LE confirmed_qty

      When i change GE to LE as mentioned by you then this condition will fail because wa_eket-menge is greater than confirmed_qty. Anyways i believe point 2 is more critical

      2. This program will subtract 2 from the second delivery schedule line as well as there is no condition preventing this from happening & this should not happen. Only when the notification qty exceeds 3 i.e 4 or above, should it start subtracting from delivery schedule line 2.

      Await your inputs

      Vivek

  • author's profile photo Former Member
    Former Member
    Posted on Nov 24, 2007 at 04:12 PM

    Can anyone help me with this? It is very urgent

    Add a comment
    10|10000 characters needed characters exceeded

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.