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

Problem while updating attribute using bapi BAPI_CASE_CHANGEATTRIBUTES

Former Member
0 Likes
2,053

Hi Guys,

Iam trying to update a attribute uisng bapi BAPI_CASE_CHANGEATTRIBUTES

Iam trying to update a standard table SCMG_T_CASE_Attr with follwing bapi. it is giving me sy-subrc value = 0 but its not updating the table..

Iam passing the case id and based on the case id iam passing the table lt_attr ( the value which has to be updated ).

If i use update statement it is updating the database table perfectly....

But updating thestandard data base table using update statement is not correct way i need to use the below bapi..

can any one let me know any thing needs to be added for the below code



 CALL FUNCTION 'BAPI_DISPUTE_ATTRIBUTES_CHANGE'
        EXPORTING
          case_guid  = v_case_guid
        IMPORTING
          return     = v_return1
        TABLES
          attributes = lt_attr.


 IF v_return1-type <> 'E' AND v_return1-type <> 'A'.

        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          IMPORTING
            return = v_return2.

endif.


8 REPLIES 8
Read only

Former Member
0 Likes
1,553

Hi

Your code reflects that commit will never get executed as the variable will not have 2 values at any point of time and an AND condition in between will never result in a return of boolean TRUE.

Regards

Raj

Read only

0 Likes
1,553

Actaully there should be < > ( not equal to ) between v_return1-type & E whicg is not visible in the code copy..

The actual code is



IF v_return1-type NE 'E' AND v_return1-type NE  'A'.
 
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          IMPORTING
            return = v_return2.
 
endif.

Read only

0 Likes
1,553

Hi Satish,

You should use OR condition, else control never comes to BAPI commit.



IF v_return1-type NE 'E' OR v_return1-type NE  'A'.
 
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          IMPORTING
            return = v_return2.
 
endif.
 

Regards,

Swarna Munukoti

Read only

0 Likes
1,553

BAPI is executing susccesfully but its not updating the data base table..

Regards

Satish Boguda

Read only

0 Likes
1,553

any update on this.... how to correct it...!!!!

Read only

0 Likes
1,553

solved my self...actually i was trying to update the wrong screen field so i got problem..

Regards

Satish Boguda

Read only

Former Member
0 Likes
1,553

Solved Myself...!!

Read only

0 Likes
1,553

Hello Satish,

I am having the same problem while updating the case attributes using BAPI_CASE_CHANGEATTRIBUTES.

Can you please kindly help me in the same.

Regards,

Vishal Chauhan