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

Problems in BAPI_OBJCL_CREATE

former_member603880
Participant
0 Likes
7,417

Hi!

We need to update texts to Business Partner in CL20N. We try to use BAPI_OBJCL_CREATE and BAPI_TRANSACTION_COMMIT in sequence. Please, help us to correct procedure.

In BAPI_OBJCL_CREATE, only the table ALLOCVALUESCHAR is filled with three lines. The columns CHARACT and VALUE_CHAR contains the characteistics and the texts that we want to update.

We pass the follow values:

OBJECTKEYNEW     - busines partner number;

OBJECTTABLENEW  - KNA1

CLASSNUMNEW      - The class name (existing)

CLASSTYPENEW     - the class type (existing)

STATUS            -  "1"

STANDARDCLASS   

CHANGENUMBER     

KEYDATE          - today

NO_DEFAULT_VALUES

Problem 1) If there isn't a Class marked to business partner, we have a RETURN table with erros:

T ID                   NUM MESSAGE                                                           

                                                                                             

I CL                   732 Assignment does not exist or is not valid on                      

E CL                   117 Class type J11, object type KNA1, object 0000018063               

E C1                   801 IDENTIFICACAO_SOCIOS: Value "051319358-FENIX EMPREENDI" not found 

I CL                   736 Assignment was not created                                       

We need to create new texts when there isnt no class marked to BP. Is there any BAPI that I can use?

Problem 2) If there is a Class assingment to business partner, we have a RETURN table with no erros, but the texts will not to be updated in business partner

T ID                   NUM MESSAGE                      

                                                         

E CL                   731 Assignment exists and is valid

But the text was not update in BP. Why the commit function is not working?

We appreciate any help!

Thanks and best regards,

GLippmann

1 ACCEPTED SOLUTION
Read only

rob_postema
Participant
0 Likes
3,553

Problem 2) If there is a Class assingment to business partner:

Ttry to change using    'BAPI_OBJCL_CHANGE'

something like this:

    CALL FUNCTION 'BAPI_OBJCL_CHANGE'
    EXPORTING
      objectkey                =  0000018063              

      objecttable              = 'KNA1'
      classnum                = 'IDENTIFICACAO_SOCIOS'
      classtype                = 'J11'
      no_default_values     = 'X'
    TABLES
      allocvaluesnumnew   = lt_allocvaluesnumnew
      allocvaluescharnew  = lt_allocvaluescharnew        "==>

      allocvaluescurrnew  = lt_allocvaluescurrnew
      return                    = lt_return.

FYI: you can use 'CLAF_CLASSIFICATION_OF_OBJECTS' to see if there is a Class-assignment

2 REPLIES 2
Read only

rob_postema
Participant
0 Likes
3,554

Problem 2) If there is a Class assingment to business partner:

Ttry to change using    'BAPI_OBJCL_CHANGE'

something like this:

    CALL FUNCTION 'BAPI_OBJCL_CHANGE'
    EXPORTING
      objectkey                =  0000018063              

      objecttable              = 'KNA1'
      classnum                = 'IDENTIFICACAO_SOCIOS'
      classtype                = 'J11'
      no_default_values     = 'X'
    TABLES
      allocvaluesnumnew   = lt_allocvaluesnumnew
      allocvaluescharnew  = lt_allocvaluescharnew        "==>

      allocvaluescurrnew  = lt_allocvaluescurrnew
      return                    = lt_return.

FYI: you can use 'CLAF_CLASSIFICATION_OF_OBJECTS' to see if there is a Class-assignment

Read only

0 Likes
3,553

Thanks.

Its works in SE37, BAPI sequence test with COMMIT.

Thanks!!!

GLippmann