cancel
Showing results for 
Search instead for 
Did you mean: 

Changing the accounting information on an SC

Former Member
0 Kudos

Hi there

I am having difficulties getting the account information on a shopping cart updated using BBP_PD_SC_UPDATE.

The background in short:

1) I have created a a field in CI_BBP_ACC

2) I read the details of a given SC with BBP_PD_SC_GETDETAIL

3) I update the field i created in CI_BBP_ACC

4) I try to update the SC with BBP_PD_SC_UPDATE.

The update part (4) does not work.

When caling BBP_PD_SC_UPDATE I have filled the following parameters:

CALL FUNCTION 'BBP_PD_SC_UPDATE'

EXPORTING

  • IV_BAPIMODE =

  • I_PARK =

i_header = ls_header_u

I_SAVE = 'X'

  • IV_REJECT =

  • IV_TESTRUN =

  • IV_MSG_SCENARIO =

  • IT_ATTACH =

  • IV_WITH_CHANGE_APPROVAL = 'X'

IMPORTING

E_CHANGED = l_changed

TABLES

I_ITEM = lt_item_icu

I_ACCOUNT = lt_account

  • I_PARTNER =

  • I_CONFIRM =

  • I_LONGTEXT =

  • I_LIMIT =

  • I_ORGDATA =

  • I_TAX =

  • I_PRIDOC =

  • I_HCF =

  • I_ICF =

  • E_MESSAGES =

.

Hopefully someone can explain to me what the problem is.

Br.

Thomas

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

Which SRM version are you using ? Please paste your detailed code for better analysis.

Why you are using this Function module ? Any specific reasons. What is your detailed business requirement ?

Have you tried BBP_DOC_CHANGE_BADI using SE18 Transaction. Do read it's docuementation, before implementing any code.

Do let me know.

Let me know incase you need further assistance.

Regards

- Atul

Former Member
0 Kudos

Hi again

It is SRM 4.0 I am curently working on.

The business logic that I am developing a solution for is the following:

In step 3 of the shopping process the company want to have an extra field in the screen where they can enter the ID of the first approver in the workflow (FG: BBP_SC_UI_ITS, screen 140).

There must be some validations of the ID entered in the field. Since we have already implemeted a lot of other checks in an implementation of BBP_MESSAGES_BADI I would also like to carry out my validations there. Since it is only the accounting information that is going in to this BADI I have created a field in the CI_BBP_ACC.

That is the reason that I want to use FM BBP_PD_SC_UPDATE and also the reason for not using BBP_DOC_CHANGE_BADI.

The code looks as follows:

  • Reading the details of the shopping cart.

CALL FUNCTION 'BBP_PD_SC_GETDETAIL'

EXPORTING

I_GUID = gs_sc-header-guid

  • I_OBJECT_ID =

  • I_ATTACH_WITH_DOC = ' '

I_WITH_ITEMDATA = 'X'

  • I_ITEM_SORTED_BY_HIERARCHY =

  • I_WITHOUT_HEADER_TOTALS =

  • I_READ_FROM_ARCHIVE = ' '

IMPORTING

E_HEADER = ls_header_d

  • EV_IS_PD =

  • ET_ATTACH =

TABLES

  • E_ITEM =

E_ACCOUNT = lt_account

  • E_PARTNER =

  • E_CONFIRM =

  • E_LONGTEXT =

  • E_LIMIT =

  • E_ORGDATA =

  • E_TAX =

  • E_PRIDOC =

  • E_HCF =

  • E_ICF =

  • E_MESSAGES =

  • E_ACTVAL =

  • E_ACC_ACTVAL =

  • E_HEADER_REL =

  • E_ITMLIM_REL =

  • E_STATUS =

.

  • Preparing the object key for the update function

move-corresponding ls_header_d to ls_header_u.

  • Updating the table with accounting information

loop at lt_account into wa_account.

wa_account-zz_approver = Z_GS_SCR_APPROVER.

modify lt_account from wa_account.

endloop.

  • Updating the shopping cart

CALL FUNCTION 'BBP_PD_SC_UPDATE'

EXPORTING

  • IV_BAPIMODE =

  • I_PARK =

i_header = ls_header_u

I_SAVE = 'X'

  • IV_REJECT =

  • IV_TESTRUN =

  • IV_MSG_SCENARIO =

  • IT_ATTACH =

  • IV_WITH_CHANGE_APPROVAL = 'X'

IMPORTING

E_CHANGED = l_changed

TABLES

  • I_ITEM =

I_ACCOUNT = lt_account

  • I_PARTNER =

  • I_CONFIRM =

  • I_LONGTEXT =

  • I_LIMIT =

  • I_ORGDATA =

  • I_TAX =

  • I_PRIDOC =

  • I_HCF =

  • I_ICF =

  • E_MESSAGES =

.

Best regards

Thomas

Former Member
0 Kudos

Hi Thomas,

First of all,you dont need to use the FM 'BBP_PD_SC_GETDETAIL' as the custom field will be autmoatically filled at runtime.

You just need to check in the structure <b>it_account[]</b> for the field value based on the logic required ..eg.

LOOP AT it_account INTO wa_account where zz_approver ne initial.

your check,if not valid data throw the error message

ENDLOOP.

P.S. you could also use the "BBP_DOC_CHECK_BADI" badi to validate the custom field.

Also when using the CHANGE Badi,you need to move the values of all importing tables to the changing tables.

e.g.move it_item[] to et_item[].

move it_account[] to et_account[].

move it_partner[] to et_partner[].

move it_orgdata[] to et_orgdata[].

move it_hcf[] to et_hcf[].

move it_icf[] to et_icf[].

HTH.

BR,

Disha.

Pls reward points for useful answers.