Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

price w.r.t to condition types

Hi Folks,

I have a problem in picking up the price depending on the condition type.I am gettin only one condition type's price for all.I think it is a problem with the select and endselect statement,can anyone here please let me know where I am going wrong.

x Amount.

*Accounting Doc.No.

SELECT BELNR

AWKEY

FROM bkpf INTO TABLE ITAB3

WHERE blart = 'RE' AND

GJAHR = P_GJAHR AND

BUKRS = P_BUKRS AND

BUDAT IN S_BUDAT.

*Excise Duty and Ed.Cess.

clear itab3.

LOOP AT ITAB3.

move-corresponding itab3 to itab4.

SELECT HWBAS

HWSTE

KBETR

FROM BSET INTO (ITAB4-HWBAS , ITAB4-hwste_x , ITAB4-KBETR)

WHERE BELNR = ITab3-BELNR1 AND

GJAHR = P_GJAHR AND

BUKRS = P_BUKRS and

KSCHL = 'JMO1'.

IF ITAB4-HWSTE_X IS INITIAL.

SELECT SINGLE

HWBAS

HWSTE

KBETR

FROM BSET INTO (ITAB4-HWBAS , ITAB4-HWSTE_X , ITAB4-KBETR)

WHERE BELNR = ITab3-BELNR1 AND

BUKRS = P_BUKRS AND

GJAHR = P_GJAHR AND

KSCHL = 'JMO2'.

*ENDSELECT.

ENDIF.

<b>upto here it is fine,but the moment it is reaching the below select statement the price of JM01 or JM02 is getting overwritten by JEC1 or JEC2.</b>

SELECT SINGLE

HWSTE

KBETR

FROM BSET INTO (ITAB4-HWSTE_Y , ITAB4-KBETR)

WHERE BELNR = ITAB3-BELNR1 AND

GJAHR = P_GJAHR AND

BUKRS = P_BUKRS AND

KSCHL = 'JEC1'.

IF ITAB4-HWSTE_Y IS INITIAL.

SELECT SINGLE

HWSTE

kbetr

FROM BSET INTO (ITAB4-HWSTE_Y, itab4-kbetr)

WHERE BELNR = ITAB3-BELNR1 AND

GJAHR = P_GJAHR AND

BUKRS = P_BUKRS AND

KSCHL = 'JEC2'.

ENDIF.

*ITAB4-HWSTE_Z = ( ITAB4-HWSTE_Y / 3 ) * 2.

*ITAB4-HWSTE_F = ITAB4-HWSTE_Y - ITAB4-HWSTE_Z.

*ITAB4-HWSTE_L = LHWSTEX.

APPEND ITAB4.

ENDSELECT.

*ENDSELECT.

ENDLOOP.

Thanks,

K.Kiran,

Tags:
Not what you were looking for? View more on this topic or Ask a question