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

BAPI_PRODORDCONF_CREATE_TT CO11N CUSTOM FIELDS

0 Likes
4,000

Dear Friends,

when I call BAPI_PRODORDCONF_CREATE_TT, How do I update the custom fields in table AFRU.

This custom fields I use in co11n.

Please guide me .

1 ACCEPTED SOLUTION
Read only

Dominik_Tylczynski
SAP Champion
SAP Champion
2,530

Hi Michael, to answer directly your question - I wouldn't use enhancement here. Instead I'd just register a change and just insert custom fields mapping directly in the code where indicated above.

Before you go and change SAP standard code I'd advise some testing first:

  1. Use SE37 to test BAPI_PRODORDCONF_CREATE_TT and save a test data for the function without any custom fields for know. Make sure that BAPI_PRODORDCONF_CREATE_TT posts a confirmation correctly with your test data.
  2. Use SE37 and run a test sequence of BAPI_PRODORDCONF_CREATE_TT with the test data saved previously and BAPI_TRANSACTION_COMMIT. Make sure that the confirmation posted in visible as you wish in standard SAP transactions and report.
  3. Know put the break-point at line "APPEND tmp_afrud_tab." and run your test sequence. Once the execution stops fill in the custom fields in tmp_afrud_tab as required and let the test sequence run. Check if your custom fields show correctly wherever you use them.

Only after the above test proves the custom fields are transferred correctly (I'm 99% positive they will), go and add the custom fields transfer to tmp_afrud_tab with a simple change to SAP standard code. Make sure to have change assistant activated so your change can be easily tracked and reapplied on patching or upgrade.

HTH

Dominik Tylczyński

Dear Friends,

when I call BAPI_PRODORDCONF_CREATE_TT, How do I update the custom fields in table AFRU.

This custom fields I use in co11n.

Please guide me .

3 REPLIES 3
Read only

Dominik_Tylczynski
SAP Champion
SAP Champion
2,530

To my knowledge BAPI_PRODORDCONF_CREATE_TT doesn't support BAPI extensions concept.

You may try to enhance BAPI_PP_TIMETICKET structure with your custom fields, the same ones you have in AFRU. Then add transfer of those fields from TIMETICKETS table to tmp_afrud_tab table in BAPI_PRODORDCONF_CREATE_TT:

* Rückmeldelohnscheine in interne Struktur AFRUD umsetzen
  LOOP AT timetickets.
    CLEAR tmp_afrud_tab.
    CALL FUNCTION 'MAP2I_PP_TIMETICKET_TO_AFRUD'
      EXPORTING
        bapi_pp_timeticket        = timetickets
      CHANGING
        afrud                     = tmp_afrud_tab
      EXCEPTIONS
        error_converting_iso_code = 1
        OTHERS                    = 2.
    IF sy-subrc <> 0.
      CALL FUNCTION 'BALW_BAPIRETURN_GET1'
        EXPORTING
          type       = sy-msgty
          cl         = sy-msgid
          number     = sy-msgno
          par1       = sy-msgv1
          par2       = sy-msgv2
          par3       = sy-msgv3
          par4       = sy-msgv4
*         LOG_NO     = ' '
*         LOG_MSG_NO = ' '
        IMPORTING
          bapireturn = return.
      EXIT.
    ENDIF.

---> customs fields transfer here

    APPEND tmp_afrud_tab.
  ENDLOOP.

That should work although I've not tested that.

Let us know if it works for you.

Best regards

Dominik Tylczyński

Read only

0 Likes
2,530

Thank you very much for your help.

Do you mean I need to use Enhancement options in BAPI_PRODORDCONF_CREATE_TT?

Can you guide me?

Read only

Dominik_Tylczynski
SAP Champion
SAP Champion
2,531

Hi Michael, to answer directly your question - I wouldn't use enhancement here. Instead I'd just register a change and just insert custom fields mapping directly in the code where indicated above.

Before you go and change SAP standard code I'd advise some testing first:

  1. Use SE37 to test BAPI_PRODORDCONF_CREATE_TT and save a test data for the function without any custom fields for know. Make sure that BAPI_PRODORDCONF_CREATE_TT posts a confirmation correctly with your test data.
  2. Use SE37 and run a test sequence of BAPI_PRODORDCONF_CREATE_TT with the test data saved previously and BAPI_TRANSACTION_COMMIT. Make sure that the confirmation posted in visible as you wish in standard SAP transactions and report.
  3. Know put the break-point at line "APPEND tmp_afrud_tab." and run your test sequence. Once the execution stops fill in the custom fields in tmp_afrud_tab as required and let the test sequence run. Check if your custom fields show correctly wherever you use them.

Only after the above test proves the custom fields are transferred correctly (I'm 99% positive they will), go and add the custom fields transfer to tmp_afrud_tab with a simple change to SAP standard code. Make sure to have change assistant activated so your change can be easily tracked and reapplied on patching or upgrade.

HTH

Dominik Tylczyński