Application Development 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: 

Insert Values to CDHDR and CDPOS

Former Member
0 Kudos

Hi ,

I am using a BAPI to create WBS which inserts a record in PRPS. I have a few custom fields in PRPS for which I need to maintain change log.

1. I have ticked the change document check box for data element.

2. Ticked change document for TAble PRPS as well.

3. Created an Object from Tx SCDO, to update through work area

WHen i call the FM in my COde its not inserting record in CDHDR, CDPOS.

IF i run the generated FM without update task .. i see a change number being created and values getting inserted into table cdhdr , but when i actually check the table .. no entries are inserted.

Am I missing setting of some important parameter?

Entered values:

objectid - WBS ELEMENT

tcode= 'CJ20n'

utime - sy-uzeit

udate-sy-datum

uname = sy-uname

PLANNED_CHANGE_NUMBER = ''

CDOC_UPD_OBJECT = 'I'.

CDOC_PLANNED_OR_REAL = ''.

CDOC_NO_CHANGE_POINTERS = ''

YPRPS = blank work area

PRPS = new values of prps for the wbs

UPD_PRPS = 'I'

UPD_ICDTXT_Z_PRPS_TXT = 'I'

TABLES :

ICDTXT_Z_PRPS_TXT - blank.

CALL FUNCTION 'SWE_REQUESTER_TO_UPDATE'.

CALL FUNCTION 'Z_PRPS_TXT_WRITE_DOCUMENT ' IN UPDATE TASK

EXPORTING OBJECTID = OBJECTID

TCODE = TCODE

UTIME = UTIME

UDATE = UDATE

USERNAME = USERNAME

PLANNED_CHANGE_NUMBER = PLANNED_CHANGE_NUMBER

OBJECT_CHANGE_INDICATOR = CDOC_UPD_OBJECT

PLANNED_OR_REAL_CHANGES = CDOC_PLANNED_OR_REAL

NO_CHANGE_POINTERS = CDOC_NO_CHANGE_POINTERS

O_YPRPS

= YPRPS

N_PRPS

= PRPS

UPD_PRPS

= UPD_PRPS

UPD_ICDTXT_Z_PRPS_TXT

= UPD_ICDTXT_Z_PRPS_TXT

TABLES ICDTXT_Z_PRPS_TXT

= ICDTXT_Z_PRPS_TXT.

Any suggestions please ?

8 REPLIES 8

former_member742973
Participant
0 Kudos

Hello,

The code below worked for me, try to see the difference

g_f_objectid = z06pde01_am_fehl-zzfn.

g_f_tcode = sy-tcode.

g_f_utime = sy-uzeit.

g_f_udate = sy-datum.

g_f_username = sy-uname.

CALL FUNCTION 'Z_AM_ERR_WRITE_DOCUMENT'

EXPORTING

objectid = g_f_objectid

tcode = g_f_tcode

utime = g_f_utime

udate = g_f_udate

username = g_f_username

n__sehl = g_r_nsehl

o_sehl = g_r_osehl

upd_sehl = 'U'.

i have used 'U' to update, check if this works.

Thanks

Thirumal

0 Kudos

Thanks for replying

I tried with U as well .. but still the data is not inserted into table

is there any special setting which creating the object class which i am missing ?

I am unable to get the error in my code

0 Kudos

Hello,

The steps are simple,

Check the change document in the data element and activate it.

Then in the SCDO create the object for the table and then you should save it.

Saving is very important, then only all the generations are saved.

Thanks,

Thirumal

0 Kudos

sorry, generate and save afterwards.

0 Kudos

Thanks for all your help

I managed to solve the issue myself .. there was a commit issue ..

now its working fine

0 Kudos

Hi Thirumal R

Can you help me in coding for creating doucment change report please

I had gone through the tables there are CDHDR and CDPOS , from this tables

These standards reports are taken from RVSD100 and RVSD200 reports which allow viewing changes on a single sales document in online mode howver the selection paratmeters for these two standard reports does not allow the selection parameters by plant code, document number, date ranges and also does not allow multiple sales document to be listed at the same time

I need a report that will allow them to list the changes made in the contract documents with more ranges options on the report selection parameters

basically this customised report will retrive all the changes made in sales contract documents within a plat , date ragne and other selection paramters

The report must allow ALV display also

sales office code and sales office description

+ contract document number

sort by date, header data filed name <01> with old and new values changes and username

sort by date, header data field name <02> with old and new values changes and username

etc....

etc...

can you please help me how to start do we required funtional module etc.,I know it is easy but i need some push to start.

regards

Piroz

former_member404244
Active Contributor
0 Kudos

Hi SREEDHAR,

When u r creating an object in SCDO,u have to generate the update program.When u do this it will create includes and function modules ,when u press on save button.I think u have done this.Now what u have to do u have to call these includes in ur program.now it should generate entries inCDHDR and CDPOS.

Regards,

Nagaraj

0 Kudos

Hi,

I have done all of that . I have pasted the FM in SDN as well , indicating what are the values I am passing

Still records are not being inserted in to cdhdr