on 02-18-2016 9:57 AM
Hi Experts,
I wanted to get the open quantity for contracts. In VA45, i got the following code written:
LOOP AT lvbmtv ASSIGNING <fs_lvbmtv>.
CLEAR:lv_menge.
LOOP AT lit_vbfa INTO lwa_vbfa WHERE vbelv = <fs_lvbmtv>-vbeln.
READ TABLE git_vbap_n INTO lwa_vbap_n WITH KEY vbeln = lwa_vbfa-vbeln.
IF sy-subrc = 0.
lv_menge = lv_menge + lwa_vbap_n-kwmeng.
ENDIF.
ENDLOOP.
CLEAR:lv_menge_n.
READ TABLE git_vbap INTO lwa_vbap WITH KEY vbeln = <fs_lvbmtv>-vbeln.
IF sy-subrc = 0.
lv_menge_n = lwa_vbap-zmeng - lv_menge.
ENDIF.
<fs_lvbmtv>-zmeng = lv_menge_n.
ENDLOOP.
MOVE lv_menge_n TO lvbmtv-zmeng.
Now, this works fine if a contract has been referenced by sales orders with single line items. But in case of multiple line items, the code only calculates the open quantity for the first line and not for the others. My ABAP consultant has been unable to get the line items included.
Could you please help me out.
Thanks
Pranay
Line item is available in VA45, it's in VBAP and in VBFA. What exactly is the problem with writing the correct ABAP code?
Are you an ABAP developer? If so, you should understand what the code does. If not - get a qualified ABAP developer to write the code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This standard transaction itself has the option "Open Contracts" to populate the report. Have you not seen this?
G. Lakshmipathi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Pranay,
To verify open quantities in contracts there is a standard function which will work depending of your configuration, does that interest you?
If your configuration is correct, you can check the pending quantity on the menu -> Environment -> Status Overview
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
what might be the reason to write the code
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
97 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.