Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ORDER_WRITE_DOCUMENT - Log not update in CDPOS

Former Member
0 Likes
2,106

Hello Everyone,

Greetings!

I am using the standard FM ORDER_WRITE_DOCUMENT  to update the PP change log for some standard fields in CDHDR and CDPOS tables.

I am passing the new and old AFKO internal tables. even i am not getting the change log updated in CDPOS and CDHDR tables.

But when i delete the whole entry of the old internal table. i am getting entries . But without the new and old values .

***************************************

CALL FUNCTION 'CO_00_CAUFVDB_AAXXX_TRANSFER'
                 EXPORTING
                   caufvdb_imp = ls_caufvdb
                 IMPORTING
                   aafko_exp   = ls_xafko
                   aaufk_exp   = ls_xaufk.
               APPEND ls_xaufk TO lt_xaufk.
               APPEND ls_xafko TO lt_xafko.


I got the LT_XAFKO values from the above FM similar for LT_YAFKO.

CALL FUNCTION 'ORDER_WRITE_DOCUMENT' IN UPDATE TASK
                 EXPORTING
                   objectid                      = l_objectid
                   tcode                         = sy-tcode
                   utime                         = sy-uzeit
                   udate                         = sy-datum
                   username                      = sy-uname

                 upd_afko                      = 'U'

       TABLES

                   xafko                         = lt_xafko
                   yafko                         = lt_yafko.



***************************************

Please give me the code sample of the FM and please share your ideas!

Thanks in advance.

Regards,

Pradeep.

Hello Everyone,

Greetings!

I am using the standard FM ORDER_WRITE_DOCUMENT  to update the PP change log for some standard fields in CDHDR and CDPOS tables.

I am passing the new and old AFKO internal tables. even i am not getting the change log updated in CDPOS and CDHDR tables.

But when i delete the whole entry of the old internal table. i am getting entries . But without the new and old values .

***************************************

CALL FUNCTION 'CO_00_CAUFVDB_AAXXX_TRANSFER'
                 EXPORTING
                   caufvdb_imp = ls_caufvdb
                 IMPORTING
                   aafko_exp   = ls_xafko
                   aaufk_exp   = ls_xaufk.
               APPEND ls_xaufk TO lt_xaufk.
               APPEND ls_xafko TO lt_xafko.


I got the LT_XAFKO values from the above FM similar for LT_YAFKO.

CALL FUNCTION 'ORDER_WRITE_DOCUMENT' IN UPDATE TASK
                 EXPORTING
                   objectid                      = l_objectid
                   tcode                         = sy-tcode
                   utime                         = sy-uzeit
                   udate                         = sy-datum
                   username                      = sy-uname

                 upd_afko                      = 'U'

       TABLES

                   xafko                         = lt_xafko
                   yafko                         = lt_yafko.



***************************************

Please give me the code sample of the FM and please share your ideas!

Thanks in advance.

Regards,

Pradeep.

4 REPLIES 4
Read only

Former Member
0 Likes
1,617

Do we need the 'Change document' flag needs to be set in Se11 data element level. ?

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,617

You could perform some search looking in standard report for call of  ORDER_WRITE_DOCUMENT or CO_VB_WRITE_DOCUMENT and CO_VB_ORDER_POST.

Once you start to use unreleased FM, you got compelled to replicate the behavior of standard reports (*).

Regards,

Raymond

(*) Alas not much data is available in BAPI_PRODORD_CHANGE and BAPI_PROCORD_CHANGE since BAPI_ALM_ORDER_MAINTAIN was forbidden (since PP/PM 'divorce' of 2008)

Read only

0 Likes
1,617

Thanks Raymond for your reply .

I have just noticed that while using this FM i am getting the CDPOS update only to the fields has the flag 'Change document' as checked.

For ex : AFKO-GAMNG - No flag in data element - no CDPOS update happened.

            AFVC-VORNR - has flag in data element - CPODS updated happened,

Regards,

Pradeep.

Read only

0 Likes
1,617

The flag on data element is required, else no log for this field.

Ref : Set Change Document Flag In Change Documents online documentation;

Regards,

Raymond.