on 2007 Feb 28 12:21 AM
Hi friends,
Im developing a SRM Purchase Order CHANGE smartform. The form should only print those line items that got changed (quantity or price or new line item added to PO). Can anyone tell me how to pass only changed datas to smartform. Im assuming that Ive copy the std. Form BBP_PO. I will award points to any useful answers
Thanks a lot.
-Nash
Hi John,
As Narendra said that we can get it from CDPOS and as well as CDHDR also.
I have done this type of Form long back, I'll send the code & change naming conventions according to that logic. This helps u a lot really.
-----TO FETCH I OR U REGARDING PO(for chg column)--
SELECT * INTO TABLE I_CDHDR FROM CDHDR WHERE
OBJECTID = W_DATA2-EBELN .
DESCRIBE TABLE I_CDHDR LINES V_COUNT.
READ TABLE I_CDHDR INDEX V_COUNT INTO W_CDHDR.
IF W_CDHDR-CHANGE_IND = 'U'.
MOVE W_CDHDR-CHANGENR TO V_CHANGE_NR.
CONCATENATE W_CDHDR-MANDANT W_DATA2-EBELN W_DATA2-EBELP
INTO GV_TABKEY.
SELECT SINGLE VALUE_OLD INTO V_OLD FROM CDPOS
WHERE OBJECTID = W_DATA2-EBELN AND
CHANGENR = V_CHANGE_NR AND
TABKEY = GV_TABKEY AND
FNAME = 'MENGE'.
SELECT SINGLE VALUE_OLD INTO V_OLD1 FROM CDPOS
WHERE OBJECTID = W_DATA2-EBELN AND
CHANGENR = V_CHANGE_NR AND
TABKEY = GV_TABKEY AND
FNAME = 'NETWR'.
ENDIF.
------ WHEN PO IS CHANGE ,TO FILL CHG COLMN DETAILS------------------*
IF V_OLD IS NOT INITIAL OR V_OLD1 IS NOT INITIAL.
W_TY_SODATA_TAB1-CHNGIND = 'cur'.
APPEND W_TY_SODATA_TAB1 TO I_SODATA.
MOVE V_OLD TO W_TY_SODATA_TAB1-MENGE.
MOVE V_OLD1 TO W_TY_SODATA_TAB1-NETWR.
W_TY_SODATA_TAB1-CHNGIND = 'prev'.
ELSE.
W_TY_SODATA_TAB1-CHNGIND = 'n/a'.
ENDIF.
APPEND W_TY_SODATA_TAB1 TO I_SODATA.
CLEAR: V_OLD, V_OLD1.
CLEAR: W_TY_SODATA_TAB1.
ENDIF.
ENDLOOP.
LOOP AT I_DATA3 INTO W_DATA3.
READ TABLE I_SODATA INTO W_SODATA WITH KEY
MATNR = W_DATA3-MATNR
EBELN = W_DATA3-EBELN
EBELP = W_DATA3-EBELP
CHNGIND = 'prev'.
IF SY-SUBRC = 0.
W_DATA3-MENGE = W_DATA3-MENGE.
W_DATA3-NETWR = W_DATA3-NETWR.
ENDIF.
APPEND W_DATA3 TO I_DATA4.
CLEAR: W_DATA3.
ENDLOOP.
<b><i>if u want the full code let me know I'll send.</i></b>
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can get the changed values from the table CDPOS..
Thanks,
Naren
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
67 | |
8 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.