on 11-15-2011 7:53 AM
Hi Experts,
My client is given few sales orders (around 4)no and requesting us, to prepare the credit block released sales orders report (include released person user ID).
*.No change logs is existing for all sales order and deliveries.
For above requirement I am using CDHDR table data but I am not getting credit block released sales order report.
Below fields I am using in CDHDR Table.
Change doc.Object (objectclas) : VERKBELEG
Document No (CHANGENR): Sales order no XXXXXXX
Transaction no (TCODE) : VKM1,VKM2,VKM3
Date(UDATE) : 25.09.2011 to 09.11.2011
Experts, Can you please help me out for this.
Thanking you!!!!
Regards,
Vijaykumar Kola
*.I'm already aware of this is a new development.
THANKS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you try t.code VKM2 for your requirement?
In your logic, as mentioned by Mayank, pass the sales order no to ObjectID field and check.
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Vijay,
Instead of passing sales order no. to CHANGENR pass the sales order no. in field OBJECTID and ensure prefixing zero's if any.
Regards
Mayank
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try this, simple report... Here we check the new value of credit status field VBUK-CMGST and if it is 'D' we know that someone used VKM* transaction to release the document. Also you need to format the sales order number with leading zeros so it occupies all 10 digits and pass it to CDHDR-OBJECTID field (and not CHANGENR field). In the below code I am using select option for sales order number, so I know it will be formatted with leading zeros and so select on CDHDR will be successful.
*&---------------------------------------------------------------------*
*& Report ZTV_TEST
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ztv_test.
TABLES: vbak, cdhdr.
SELECT-OPTIONS: s_saldoc FOR vbak-vbeln OBLIGATORY,
s_udate FOR cdhdr-udate.
RANGES: r_objid FOR cdhdr-objectclas.
DATA: ls_cdhdr TYPE cdhdr,
ls_cdpos TYPE cdpos.
IF NOT s_saldoc IS INITIAL.
LOOP AT s_saldoc.
MOVE-CORRESPONDING s_saldoc TO r_objid.
CONDENSE: r_objid-high, r_objid-low.
APPEND r_objid.
ENDLOOP.
ENDIF.
CHECK NOT r_objid[] IS INITIAL.
SELECT *
INTO ls_cdhdr
FROM cdhdr
WHERE objectclas = 'VERKBELEG' AND
objectid IN r_objid AND
udate IN s_udate AND
tcode LIKE 'VKM%'.
SELECT SINGLE *
INTO ls_cdpos
FROM cdpos
WHERE objectclas = ls_cdhdr-objectclas AND
objectid = ls_cdhdr-objectid AND
changenr = ls_cdhdr-changenr AND
tabname = 'VBUK' AND
fname = 'CMGST' AND
value_new = 'D'.
IF sy-subrc = 0.
WRITE:/ ls_cdhdr-objectid(10), ls_cdhdr-username,
ls_cdhdr-udate, ls_cdhdr-utime.
ENDIF.
ENDSELECT.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
110 | |
12 | |
11 | |
6 | |
5 | |
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.