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 append fields in customer master via BAPI?

jrgkraus
Active Contributor
1,414

I need to update append fields of KNA1 and KNVV (via IDOC). Since we need change pointers for those changes, I should have change documents for these changes.

BAPI_CUSTOMER_CHANGEFROMDATA1 doesn't seem to have a mechanism for updating append fields. Is there a possibility to update those fields with creation of change documents?

10 REPLIES 10

p244500
Active Contributor
0 Kudos
294

what do you mean by " append fields"? Do you mean that you need add custom fields or what?

chaouki_akir
Contributor
294

A minima, change document flag, for the data elements of the appended fields, should be checked.

This BAPI is calling a "WRITE Document" function. Then Change pointers should be inserted (for each field with a DTEL having "change document" checked).

  OBJECTID = XKUNNR.                                        "mi/45B
  CALL FUNCTION 'DEBI_WRITE_DOCUMENT           ' IN UPDATE TASK
       EXPORTING
*           objectid                = xkunnr            "mi/45B
            OBJECTID                = OBJECTID              "mi/45B
            TCODE                   = CODE
            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
            O_YKNA1                 = YKNA1
            N_KNA1                  = KNA1
            UPD_KNA1                = VKZ-KNA1
....

thanga_prakash
Active Contributor
0 Kudos
294

Hi Jörg Krause

Did you try with SE18 Enhancement spot 'CUSTOMER_ADD_DATA_BI' (Additional Data at Customers (Batch Input and ALE)), try with below two methods.

FILL_BI_TABLE_WITH_OWN_SEGMENT - Fill Batch Input Table from Own Segment (ALE Inbound Proc.)

PASS_NON_STANDARD_SEGMENT - Pass On Customer-Defined Segments (ALE Inbound Processing)

jrgkraus
Active Contributor
0 Kudos
294

Yes, we have an append structure on KNA1 and KNVV with own fields in it. Actually, we are doing a db update to maintain them because I did not find a way to maintain them via BAPI

srikanthnalluri
Active Participant
0 Kudos
294

@Jörg Krause Not sure this is wise way - I would create a new function module and keep all the BAPI - BAPI_CUSTOMER_CHANGEFROMDATA1 import, export and tables along with custom fields in the created FM. Then in the FM i would update custom fields if the BAPI call is success.

0 Kudos
294

In this case I will not have change documents as well....

0 Kudos
294

You can maintain change log as well, please check below link which explains how to maintain change log for custom fields.

https://wiki.scn.sap.com/wiki/display/ABAP/Maintaining+Change+Log+for+Database+Tables?original_fqdn=...

0 Kudos
294

I need an application log (cdhdr, cdpos), not a database log.

chaouki_akir
Contributor
0 Kudos
294

Are, the data elements of your append fields, have "change document" checked ?

jrgkraus
Active Contributor
0 Kudos
294

Yes, this flag is set. But since I do a DB update, there is no effect.