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: 

Change pointers and Idoc creation

Markus_Schutz
Participant
0 Kudos

Hello,

I would like to create change pointers for any changes regarding one of our customer infotypes: 9002 (hrp9002)

I was able to do that, however, I'm struggeling with the details.

The problem is that I do not want to send any data related to infotype 9002. I just need this change pointer to trigger idoc creation for the related objects.

Example: Let's assume that infotype 9002 gets created for position S 40001234. Once a night a customer report is executed via a job which reads all unprocessed change pointers (including the one mentioned above) and sends the corresponding object. In this case, an Idoc for the holder of position 40001234 should be created WITHOUT data for infotype 9002.

The message type is HRMD_A.

What do I need to do?

Thank you for your input.

4 REPLIES 4

anub
Participant
0 Kudos

Hi Markus,

I am having problem in activating change pointer for my custom infotype HRP9500. I am unable to see the changed log in the ALE output or in BDCP2 table. How did you get the change pointer activated, please let me know.

Thanks

Anu.

Former Member
0 Kudos

Hi,

For Info type 9002 we need to implement Badi HRALE00CHANGE_PTRS using below code.

   LOOP AT  t_changed_objects  INTO   wa_changed_objects .
    CASE  wa_changed_objects-infty.

      WHEN '9002'.
        wa_cp_data-tabname = 'HROBJINFTY'.

        wa_changed_objects-plvar = '01' .

        wa_cp_data-tabkey  = wa_changed_objects .
        wa_cp_data-cdchgid = 'U'.
*  wa_cp_data-CDOBJCL = 'HRMD_A'.

        APPEND wa_cp_data TO t_cp_data1 .
    ENDCASE.

  ENDLOOP.


  IF t_cp_data1 IS NOT INITIAL .

    CALL FUNCTION 'CHANGE_POINTERS_CREATE_DIRECT'
      EXPORTING
        message_type          = 'HRMD_A'
      TABLES
        t_cp_data             = t_cp_data1
      EXCEPTIONS
        number_range_problems = 1
        OTHERS                = 2.
    IF sy-subrc <> 0.
* Implement suitable error handling here
    ENDIF.

  ENDIF.

This code will create entry in BDCP2 table.

After thsi populating segemnet you need to code for below exit as .

EXIT_SAPLRHAL_003

   IF PNNNN_NAME = 'P9002' .

*FIELD-SYMBOLS: <FS_plog> TYPE ANY.   "Field Symbol for dynamic filling of data based on the structure

*Clearing the SUBRC
CLEAR SUBRC.
* fill workarea for infotype with infotype-data
ASSIGN pnnnn_data TO <FS_plog> CASTING TYPE P9002.
LS_9002 = <FS_plog>.
* move fields
MOVE-CORRESPONDING LS_9002 TO LS_p9002.
* fill IDoc-data with workarea for segmenttype
ASSIGN sdata_data TO <FS_plog> CASTING TYPE Z1P9002.
<FS_plog> = LS_P9002.

CONVERTED = ZCDP_IF_CONSTANTS_DTIRIS=>GC_CROSS .

ENDIF.

It will work fine.

Thanks

Anju

0 Kudos

Hello Anju,

Thank you very much for your post to above question.

I have a similar requirement, but need to add infotype 0290 to be tracked for change pointers.

So any changes created for IT0290 should get tracked and records should be created in BDCP2 table.

Can you please help?

Vaishali

0 Kudos

hello Anju,

Good News! I managed to create an entry in BDCP2 table - so I can see that the CP is created.

Now i also implemented the user exit you mentioned - but couple of questions -

what does the below statement mean?

CONVERTED = ZCDP_IF_CONSTANTS_DTIRIS=>GC_CROSS .

Also the user exit didnt pick up the new entries created in BDCP2 table. any inputs?