05-26-2016 2:11 PM
Hi All,
I want to capture wbs element in Z_Report from service purchase order ( item category D ) . There are duplicate wbs element which has been posted in lines . In our report , only the single wbs element is getting captured . but where ever there is repetition of wbs element in lines. Z_Report is unable to read this, as the table is not getting updated with duplicate wbs.
T. & R.,
Sudhir Singh
05-27-2016 9:54 AM
05-27-2016 9:58 AM
05-27-2016 12:41 PM
05-28-2016 11:26 AM
Dear Sir ;
Please check what table you are using to get line item wise Account assignment number .
there must be some problem .
Joydeep Mukherjee
05-28-2016 1:01 PM
Hi Sudhir,
Kindly it is better to share your screen shot so that correct information of your query will be
addressed.
Thanks,
Vivek
05-30-2016 9:10 AM
Hi Sudhir Singh,
Please check select on EKPO table and field DISUB_PSPNR for WBS element.
While populating final internal table which shows output might been failing populating wbs elements so which shows you only one value. It might have read statement ,check if READ statement is failing
Regards,
Pravin
06-03-2016 11:09 AM
Hi All,
Thanks for reply...!!!
Actually i am taking from EKKN - PS_PSP_PNR .
06-03-2016 11:11 AM
Hi Can you paste the query that you are using and the screen shot from the table also
06-03-2016 11:39 AM
SELECT EBELN
EBELP
PS_PSP_PNR FROM EKKN INTO CORRESPONDING FIELDS OF TABLE IT_EKKN
FOR ALL ENTRIES IN IT_EKPO WHERE EBELN = IT_EKPO-EBELN
AND EBELP = IT_EKPO-EBELP.
06-03-2016 11:41 AM
Dear sir ;
Yes i was right ;
EKKN can only be used in the case of Material .
for Service use the below table
ESKL - Account assignment specification for service line
ESKN - Account assignment in service package
ESLL - Lines in service package
Please check the constellation of interlinked table before giving new logic .
Best Regards;
Joydeep Mukherjee
06-03-2016 11:53 AM
hi,
does not exist WBS in below table. please explain....
ESKL - Account assignment specification for service line
ESKN - Account assignment in service package
ESLL - Lines in service package
Regards,
Sudhir
06-03-2016 12:00 PM
Dear sir ;
it is there please check .
For each service line item there is a package number ( Main service Line ) and pass this to ESLL table and get the subpackage .and pass this to other table as mentioned above .
Joydeep
06-03-2016 12:12 PM
Could you please suggest where 'subpackage ' will be located in ESKL
ESKN & ESLL Table. how we will get this.
06-03-2016 12:18 PM
Dear Sir ;
First Pass the original Package number (from EKPO table ) to ESLL table ,in ESLL table you will get another package number ( In general Oririnal Package +1 )
Joydeep
06-03-2016 12:32 PM
The following code which I have done for my one of the requirement.This will helps you,
SELECT * FROM EKKN INTO TABLE IT_EKKN WHERE PS_PSP_PNR IN LR_WBS[] .
IF IT_EKKN[] IS NOT INITIAL.
IT_EKKN1[] = IT_EKKN[].
SORT IT_EKKN BY EBELN EBELP.
DELETE ADJACENT DUPLICATES FROM IT_EKKN1 COMPARING EBELN EBELP.
SELECT * FROM ESLH INTO TABLE T_ESLH FOR ALL ENTRIES IN IT_EKKN1 WHERE EBELN = IT_EKKN1-EBELN
AND EBELP = IT_EKKN1-EBELP
AND BSTYP = 'F'
AND ESLH~PACKNO <> ESLH~HPACKNO.
SELECT * FROM EKPO INTO TABLE TT_EKPO FOR ALL ENTRIES IN T_ESLH WHERE EBELN = T_ESLH-EBELN
AND EBELP = T_ESLH-EBELP
AND LOEKZ EQ ''." AND STATU EQ ''.
IF T_ESLH[] IS NOT INITIAL.
SELECT * FROM ESLL INTO TABLE IT_ESLL FOR ALL ENTRIES IN T_ESLH WHERE PACKNO = T_ESLH-PACKNO." AND DEL NE 'X'.
IF IT_ESLL[] IS NOT INITIAL.
SELECT * FROM ESKL INTO TABLE T_ESKL FOR ALL ENTRIES IN IT_ESLL WHERE PACKNO = IT_ESLL-PACKNO AND INTROW = IT_ESLL-INTROW.
IF T_ESKL[] IS NOT INITIAL.
LOOP AT IT_ESLL INTO WIT_ESLL.
READ TABLE T_ESKL INTO W_ESKL WITH KEY PACKNO = WIT_ESLL-PACKNO INTROW = WIT_ESLL-INTROW.
IF SY-SUBRC = 0.
READ TABLE T_ESLH INTO W_ESLH WITH KEY PACKNO = WIT_ESLL-PACKNO.
IF SY-SUBRC = 0.
READ TABLE TT_EKPO INTO WW_EKPO WITH KEY EBELN = W_ESLH-EBELN EBELP = W_ESLH-EBELP.
IF SY-SUBRC = 0.
READ TABLE IT_EKKN INTO WIT_EKKN WITH KEY EBELN = W_ESLH-EBELN EBELP = W_ESLH-EBELP ZEKKN = W_ESKL-ZEKKN.
IF SY-SUBRC = 0.
WA_SCPRICE-PACKNO = W_EKKN-PACKNO = WIT_ESLL-PACKNO.
W_EKKN-FPACKNO = W_ESLH-FPACKNO .
W_EKKN-KNUMV = W_ESLH-KNUMV.
W_EKKN-EBELN = W_ESLH-EBELN.
W_EKKN-EBELP = W_ESLH-EBELP.
W_EKKN-WAERS = W_ESLH-WAERS .
W_EKKN-WKURS = W_ESLH-WKURS .
WA_SCPRICE-INTROW = WIT_ESLL-INTROW.
WA_SCPRICE-EXTROW = WIT_ESLL-EXTROW.
WA_SCPRICE-SRVPOS = WIT_ESLL-SRVPOS.
WA_SCPRICE-MATKL = WIT_ESLL-MATKL.
WA_SCPRICE-MENGE = WIT_ESLL-MENGE.
WA_SCPRICE-MEINS = WIT_ESLL-MEINS.
WA_SCPRICE-TBTWR = WIT_ESLL-TBTWR.
WA_SCPRICE-NETWR = WIT_ESLL-NETWR.
WA_SCPRICE-KTEXT1 = WIT_ESLL-KTEXT1.
WA_SCPRICE-ACT_WERT = WIT_ESLL-ACT_WERT.
W_EKKN-SAKTO = WIT_EKKN-SAKTO .
W_EKKN-PS_PSP_PNR = WIT_EKKN-PS_PSP_PNR .
W_EKKN-ZEKKN = WIT_EKKN-ZEKKN.
W_EKKN-EXTROW = WIT_ESLL-EXTROW.
APPEND WA_SCPRICE TO IT_SCPRICE.
APPEND W_EKKN TO T_EKKN.
CLEAR :WW_EKPO.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
**********************************************************************
IF T_EKKN[] IS NOT INITIAL.
IF IT_SCPRICE[] IS NOT INITIAL.
SELECT KNUMV KWERT FROM KONV INTO TABLE IT_DISCOUNT FOR ALL ENTRIES IN T_EKKN WHERE KNUMV = T_EKKN-KNUMV
AND KSCHL = 'RA00' AND KHERK = 'C' .
IT_SCPRICE1[] = IT_SCPRICE[].
REFRESH IT_SCPRICE.
LOOP AT IT_SCPRICE1 INTO WA_SCPRICE.
READ TABLE T_ESKL INTO W_ESKL WITH KEY PACKNO = WA_SCPRICE-PACKNO INTROW = WA_SCPRICE-INTROW.
IF SY-SUBRC = 0.
READ TABLE T_EKKN INTO W_EKKN WITH KEY PACKNO = WA_SCPRICE-PACKNO ZEKKN = W_ESKL-ZEKKN.
IF SY-SUBRC = 0.
WA_SCPRICE-KNUMV = W_EKKN-KNUMV .
WA_SCPRICE-EBELN = W_EKKN-EBELN .
WA_SCPRICE-EBELP = W_EKKN-EBELP .
WA_SCPRICE-WAERS = W_EKKN-WAERS .
WA_SCPRICE-WKURS = W_EKKN-WKURS .
WA_SCPRICE-SAKTO = W_EKKN-SAKTO .
WA_SCPRICE-PS_PSP_PNR = W_EKKN-PS_PSP_PNR.
WA_SCPRICE-ZEKKN = W_EKKN-ZEKKN .
IF WA_SCPRICE-WAERS <> 'QAR'.
PERFORM CURRENCY_CONVERSON_FACTOR USING WA_SCPRICE-NETWR WA_SCPRICE-WAERS CHANGING WA_SCPRICE-NETWR.
ENDIF.
READ TABLE IT_DISCOUNT INTO WA_DISCOUNT WITH KEY KNUMV = WA_SCPRICE-KNUMV.
IF SY-SUBRC EQ 0.
WA_SCPRICE-NETWR = WA_SCPRICE-NETWR + WA_DISCOUNT-KWERT.
ENDIF.
APPEND WA_SCPRICE TO IT_SCPRICE.
ENDIF.
ENDIF.
CLEAR :WA_DISCOUNT,WA_SCPRICE,W_EKKN.
ENDLOOP.
ENDIF.
ENDIF.