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

Change append fields in customer master via BAPI?

jrgkraus
Active Contributor
5,185

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?

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
Read only

Nawanandana
Active Contributor
0 Likes
4,065

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

Read only

chaouki_akir
Contributor
4,065

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
....

Read only

ThangaPrakash
Active Contributor
0 Likes
4,065

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)

Read only

jrgkraus
Active Contributor
0 Likes
4,065

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

Read only

srikanthnalluri
Active Participant
0 Likes
4,065

@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.

Read only

0 Likes
4,065

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

Read only

0 Likes
4,065

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=...

Read only

0 Likes
4,065

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

Read only

chaouki_akir
Contributor
0 Likes
4,065

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

Read only

jrgkraus
Active Contributor
0 Likes
4,065

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