cancel
Showing results for 
Search instead for 
Did you mean: 

Automatic Creation of DIR(CV01N) from Specification Save CG02

Former Member
0 Kudos

Hi,

I have a requirement to create a DIR (CV01N) when a specification is saved using T-code CG02.

The User exits C10Y0001 and C10Y0002 are not getting triggered when I hit save or change status. For Creating DIR I am using BAPI_DOCUMENT_CREATE2. Please suggest from where do I trigger the BAPI from CG02 save

Accepted Solutions (0)

Answers (1)

Answers (1)

christoph_bergemann
Active Contributor
0 Kudos

Dear Umayal

both exits are related to the "Status" handling. If you are not using "Status" nothing will happen during save in CG02. What is the purpose of creating a "DIR"? Clearly there are alternative exits etc. but I have some doubt regarding your requirement.

C.B.

Former Member
0 Kudos

Hi,

  I understand that these are related to status. I am not able to find any exits at save of a specification. Please suggest.

Regards,

Uma

Former Member
0 Kudos

Hi,

  Thanks !

  As per the link I created the following code to get the buffer details of ESTRH but it does not return:

CALL FUNCTION 'C1A0_ESTRH_BUF_CHANGED'

      IMPORTING

        E_FLG_CHANGED = L_FLG_CHANGED.

* finish this user exit, if nothing was changend

    CHECK L_FLG_CHANGED = ESP1_TRUE.

* get a copy of the buffer table of ther spec heade

    REFRESH L_BUFTAB.

    CALL FUNCTION 'C1A0_ADMIN'

      EXPORTING

        I_ACTION = 'BUFTAB_GET'.

    CALL FUNCTION 'C14Z_IMPORT_FROM_MEMORY'

      EXPORTING

        I_ID = 'EHSB_BUFTAB'

      TABLES

        TAB  = L_BUFTAB.

do we have to give a different buffer id?

Regards,

Uma

christoph_bergemann
Active Contributor
0 Kudos

Dear Uma

before we discuss code (if it is correct or wrong): what is your business demand? Which type of document to be linked to EHS? Should the user be able to retrieve it? Why to create any (???) one a new one during "Save"?

PS: may be read deeper in: http://www.consolut.com/en/s/sap-ides-access/d/s/doc/YN-IF_EX_EHSS_SPEC_CHECKS~~~~~~~~AT_SAVE_CHECK

ESTRH might not be the "right" table to check. ESTRH is "triggered" often during SAVE (because of update of administration information). "More" useful might be: ESTMJ, ESTRI. But to "decide" or provide hints I need to understand better the requirement (as you can e.g. store documents on level of identifer if needed and on level of user defined text as well; not talkjing about th eoption to use "Inbound" documents.

C.B.