cancel
Showing results for 
Search instead for 
Did you mean: 

Doc flow link and delink using CRM_ORDER_MAINTAIN

Former Member
0 Kudos


Hi,

I have a requirement to link/delink transactions in SOLMAN 7.1

I tried to create and delete the links through the FMs CRM_ORDER_MAINTAIN and CRM_ORDER_SAVE.

I have a problem with creating and deleting the links when there are 2 orders to be dealt where the parent GUID is same and the child guids are different. Only the first row of data is getting updated.

CALL FUNCTION 'CRM_ORDER_MAINTAIN'

          CHANGING

            ct_input_fields   = lt_input_fields

            ct_doc_flow       = lt_doc_flow

          EXCEPTIONS

            error_occurred    = 1

            document_locked   = 2

            no_change_allowed = 3

            no_authority      = 4

            OTHERS            = 5.

        IF sy-subrc = 0.

          IF lt_guids_temp[] IS NOT INITIAL.

            CALL FUNCTION 'CRM_ORDER_SAVE'

              EXPORTING

                it_objects_to_save   = lt_guids_temp

              IMPORTING

                et_saved_objects     = lt_saved_obj

                et_exception         = lt_exception

                et_objects_not_saved = lt_obj_not_saved

              EXCEPTIONS

                document_not_saved   = 1

                OTHERS               = 2.

            IF sy-subrc EQ 0.

              IF lt_saved_obj IS NOT INITIAL.

                COMMIT WORK.

              ENDIF.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I solved it. I just had to append the second row of data to the doc_link table inside lt_doc_flow. So, lt_input_fields and lt_doc_flow will have only one row each. and the doc_link internal table will have 2 rows of data.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello,

I would put a break-point in CRM_ORDER_MAINTAIN, do your steps manually in WebUI or GUI and see how the import structures are filled. Important is IT_IMPORT_FIELDS and IT_DOC_FLOW as you have already seen.

Best regards,

Thomas Wagner