cancel
Showing results for 
Search instead for 
Did you mean: 

Validation of SC/PO

Former Member
0 Kudos

Hi all,

I am doing FI validation in SRM 4.0.Actually i am getting error based on the GL account and company code at line item which are based on the costcenter or internal order or WBS using...for this i am using FM BAPI_ACC_GL_POSTING_CHECK(RFC enabled) from R3 to SRM.the error message i am getting i was populating while creating SC/PO in the DOC_CHECK_BADI ..One strange thing is for testing i have commented the code in DOC_CHECK_BADI still i am getting the error based on GL account and company code ..firstly i thought i might be some other error but this is the same error i am getting from the BAPI_ACC_GL_POSTING_CHECK..

I want to know is there any standard functionality that the error is coming from the backend or it is the code that i have written

Thank you

.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

For the time being, de-activate the BADI Implementations. Forget your code.

Coming to the Basics, You need to do FI Validation in SRM 4.0.

Which EBP Scenario are you using ?

What's the exact requirement ? You want to do validation in SRM side.

Have you maintained the G/L Accounts, WBS Elements, Orders at SRM side. ?

Incase i understood you correctly, you need to do validation at SRM system only.

Have you seen there are few BADIs in SRM system, already avaiabale for FI Validation purpose ?


 BAdI Definition Name                   Description                                                   

<b>BBP_ACCCAT_MAP_EXP</b>

Exit for changing account assign. cat. by mapping EBR to R/3

<b>BBP_ACCCAT_MAP_IMP </b>

Exit for changing account assign. cat. by mapping R/3 to EBR

<b>BBP_ACC_CHECK_ICC</b>

Account Assignment Check

<b>BBP_DETERMINE_ACCT </b>

Exit while determining G/L account for account assignment

Please share your comments at the earliest.

Hope this will help.

Please reward full points, incase it suits your requirements.

Regards

- Atul

Former Member
0 Kudos

SRM 4.0 Extended classic scenario

My requirement is to raise a error message when i select GL account which is not there or related to certain company code(which i will getting with FM BAPI_ACC_GL_POSTING_CHECK) while creating SC/PO

I dont think we have maintained G/L Accounts, WBS Elements, Orders at SRM side..

Yes we need to do validation in SRM side

<b>But one thing my functional head is telling that there is no standard functionality do this...he says that there might be code in some other BADI that this validation id done...</b>

Former Member
0 Kudos

Hi

<b>Inorder to check you have any active custom BADI implementations,

Use transaction - SE19.</b>

<u>In the BADI Implementation name look for all BADI's satrting with either 'Y* or 'Z*' are there.

Incase you have any BADI implemnattaions names starting with Y* or Z*, see whether the BADIs are in Active or Inactive state.

Incase any of the BADIs are active, for the time being, De-activate the BADIs in SE19 and it will ask for a Transport.

Check after De-activating all the Custom BADIs, if the error is again coming up, when creating a new Shopping cart / PO.

If yes, then it's coming - then we need to chk it out. Else

If no, it's due to some of your BADIs wrong implementation.</u>

Do keep me posted.

Hope this will help.

Please reward full points, incase it suits your requirements.

Regards

- Atul

yann_bouillut
Active Contributor
0 Kudos

Hi,

No sure now to clearly understand your requirement...

1-In standard, while doing real time FI validation with the backend, error message from the backend are coming on the SRM side as if you were doing it directly in the backend.

2-Of course, if you have to implement a non R/3 standard FI check in the SRM side, then yes you will have to implement a badi on the srm side.

Could you please confirm option 1 or 2 ?

Kind regards,

Yann

yann_bouillut
Active Contributor
0 Kudos

Hi,

What is the exact error message ?

Kind regards,

Yann

Former Member
0 Kudos

Some of the error messages:

"WBS element T-00042995.V is not an account assignment element"

"Error: Account 60000000 cannot post to WBS element V-00001. "

yann_bouillut
Active Contributor
0 Kudos

Hi ravi,

As i told you before :

This error message is coming from R/3.

If you go in CJ20N and enter your WBS element, you should have flagged the "Indicator Account assignment element" box (field BELKZ in PRPS table)

-> select basic data tab

-> section " operative indicator"

-> Indicator: Account assignment element

Could you please confirm that in R/3 for your WBS element, this flag is set.

If not set, you will have this error message displayed in SRM.

Kind regards,

Yann

Former Member
0 Kudos

Hi Yann,

I went in CJ20N i have entered WBS element T-00042995.V ..it is giving some tabs such as SAP ATTRIBUTES,TITLE ATTRIBUTES,USER ATTRIBUTES, ADMINSTRATIVE AND SUPERIOR..where is basic data tab..i didnt find can u give in detail...

Thank you very much...

Former Member
0 Kudos

Hi Yann,

I have found that one...YES it is unchecked..u r right...so if it is checkd then what happens..can u explain in detail..

<b>AND what about cost center and Order elements how to find them..whether this indicator is checked or not</b>

Thank you

Ramki
Active Contributor
0 Kudos

Hi Ravi

The WBS elements which have Account assignment checked can only be used in Account Assignment in PR/PO etc.

Before checking it, you should check with the project manager of that project. They would have identified some WBS element as Billing element (that can be used in Sales) and some WBS elements as account assignment elements to collect costs.

Use a WBS element which has this field ticked.

Best regards

Ramki

yann_bouillut
Active Contributor
0 Kudos

Hi Ravi,

You're welcome

As soon as this box is ticked, error message will disappear.

Please see also Ramki answer.

Kind regards,

Yann

Former Member
0 Kudos

Thank you !

But regarding the cost center and Order elements how to check whether this type of indicator is checked or not..

Please help..

Ramki
Active Contributor
0 Kudos

Hi Ravi

Normally, they should work.

-For order check KO03-Control tab allowed txns (check for purcase order, requisition etc)

- For Cost Center - check KS03 - check whether primary cost/second cost updates are locked(but I do not think we have restriction of usage here)

Best regards

Ramki

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi

Which SAP version you are currently using ?

There can be couple of reasons which need to be checked thoroughly.

Is it giving error as "GL Account XXXYYYZZZ8 is not created, please check your input" ?

Then try using those G/L Accounts with company code combinations, which does not create an error message, once the Back-end document is created in SAP R/3 system directly. Assign the same to the Shopping cart line items and then try out.

----


Please ensure the following ->

1) If you create a PR or PO directement in R/3 (= without SRM), do you get the same error ?

Account assignment type "P" for project has to be maintained in transaction OME9. If you do use standard configuration , both on SRM AND R/3 sides, you should not have this issue. However, if you work with EBP 3.5, i guess it means that the system was working well before.

2)

Check the field status group assigned to the GL Account in Tx FS00.

And look at the field 'Field Status Group' of 'Create/bank/interest' tab.

Double click on the field status group field, and check for the 'Additional account assignments' - Check here whether the WBS/Cost center/profit center are suppresed. If suppresed you cant use this GL to post against the cost objects.

3) Try to use the same GL account and the same WBS element you used in SRM while creating the PO in R3 (to check for the error). I suspect, you will come up with the same error as what you got in SRM.

Generally this error will pop up if there are any mismatch between the field status groups assigned to the GL account and the cost object P (projects/WBS). Check for the field 'Network' in both of the field status groups.

Also, There are 2 ways to determine GL in SRM.

1. Maintain GL codes for product categories & Account assignment in SPRO. With this relevant GL code will be picked in SRM for the selected product category.

SRM server>Cross appln basic setting>Acct assignment--->Define GL acct for product category

2. Maintain logic to determine GL code in BADI BBP_DETERMINE_ACCT. In this BADI use ITEM_DATA and ACCT_DATA tables in method DETERMINE_ACCOUNT.

If you need to overwrite these,you will need to implement the BADI "BBP_DETERMINE_ACCT" and method "DETERMINE_ACCOUNT".

In this method ,use the FM "MR_ACCOUNT_ASSIGNMENT" for the retreiving the G/L account from R/3.

Hope this will help.

Please reward full points, incase it suits your requirements.

Regards

- Atul

yann_bouillut
Active Contributor
0 Kudos

Hi,

When you are saying "FI validation in SRM 4.0", dso you mean that the check has to be done against SRM system and NOT against the backend system ?

If yes, you should have flagged "local FI validation" in "define backend system" configuration point.

Please confirm.

Kind regards,

Yann

Former Member
0 Kudos

Hi

We have faced a similar issue quite a long time back in one of our SRM implementations.

It's coming from SRM itself. It's a standard functionality / or you can call it as a bug.

Regards

- Atul

Former Member
0 Kudos

Are u sure that it is standard functionality ..one strange thing is the same error we are not getting in the quality server where as in development we are getting the error..

Why this is happening i have already placed the validation code in the DOC_CHECK_BADI in Q is it preventing to display ?one more thin the validation is working fine for POs creation where as in SC the validation is not working..

please help me out from this..

Former Member
0 Kudos

Hi Yann,

See what i am doing.. i am calling the FM BAPI_ACC_GL_POSTING_CHECK which is there in R3 which is RFC enabled i am calling this FM in the SRM BADI DOC_CHECK_BADI and getting the error message and populating to one the structure ..

Former Member
0 Kudos

Some of the error messages:

"WBS element T-00042995.V is not an account assignment element"

"Error: Account 60000000 cannot post to WBS element V-00001. "

yann_bouillut
Active Contributor
0 Kudos

Hi Ravi,

This error message is coming from R/3.

If you go in CJ20N and enter your WBS element, you should have flagged the "Indicator Account assignment element" box (field BELKZ in PRPS table)

-> select basic data tab

-> section " operative indicator"

-> Indicator: Account assignment element

Kind regards,

Yann

Former Member
0 Kudos

Yes yann,

Thats what i am telling i am getting this error from R3 only..but do i get this error message by standard functionality in SRM or code in DOC_CHECK_BADI..

My requirement is i need to raise error message in SRM ITS when i select wrong GL account based on company code i.e, when i execute with same GL account and company code in R3 FM BAPI_ACC_GL_POSTING_CHECK if it gives eror then i need to pick that error from R3 to SRM while creating PO/SC..but some how it is coming even if i comment the code what i have wrote in DOC_CHECK_BADI for this validation...

I just want to confirm is there any standard functionality there from which i am getting this FI validation error or i need to write code in BADI inorder to get that error..

Thank you ...

yann_bouillut
Active Contributor
0 Kudos

Hi Ravi,

I would say that this is standard functionality.

You do not have anything to do in badi if you have already set " real time backend validation".

Kind regards,

Yann

Former Member
0 Kudos

Do u confirm it as standard functionality??

But why it is varying in my Quality system??

Will there be any case that the code is written somewhere else that it is raising the error message ??

Please help

Former Member
0 Kudos

Hi

What code you have wrriten in BBP_DOC_CHECK_BADI for this purpose ?

I think there is some problem in the 'Z' BADI Implentation, thta you have created.

What you want to do ? Please elaborate your requirements and paste the code here so that i can analayze the same.

Hope this will help.

Please reward full points, incase it suits your requirements.

Regards

- Atul

Former Member
0 Kudos

<b>BADI CODE IN DOC_CHECK_BADI FOR POS</b>

  • For direct PO's, R/3 validation. Get PO details

Data: WA_HEADER TYPE BBP_PDS_PO_HEADER_D,

LT_ITEMDATA TYPE TABLE OF BBP_PDS_PO_ITEM_D,

WA_ITEMDATA LIKE LINE OF LT_ITEMDATA,

LT_ACC TYPE TABLE OF BBP_PDS_ACC,

WA_ACC LIKE LINE OF LT_ACC,

lt_bapiache08 type zbapiache08,

lt_bapiacgl08 type table of ZBAPIACGL08,

wa_bapiacgl08 type ZBAPIACGL08,

lt_bapiaccr08 type table of ZBAPIACCR08,

wa_bapiaccr08 type ZBAPIACCR08,

lt_return type table of BAPIRET2,

wa_return type BAPIRET2,

wa_messages type BBP_SMESSAGES_BADI,

lv_docdate(8),

lv_pstngdate(8),

lv_counter type i,

lv_value(15),

lv_amount(16),

lv_len type i,

LV_SYSID(9).

*----


UPDK900880

DATA : LV_PROFIT_CTR(4).

*----


UPDK900880

  • get purchase order details

IF SY-UCOMM = 'SAVE' AND SY-TCODE = 'BBP_POC'.

*IF SY-UCOMM = 'CHEC' AND SY-TCODE = 'BBP_POC'.

CALL FUNCTION 'BBP_PD_PO_GETDETAIL'

EXPORTING

I_GUID = IV_DOC_GUID

  • I_OBJECT_ID =

I_WITH_ITEMDATA = 'X'

IMPORTING

E_HEADER = WA_HEADER

TABLES

E_ITEM = LT_ITEMDATA

E_ACCOUNT = LT_ACC

.

*----


UPDK900880

LOOP AT LT_ACC INTO WA_ACC.

MOVE WA_ACC-PROFIT_CTR+0(4) TO LV_PROFIT_CTR.

ENDLOOP.

*----


UPDK900880

  • Concatenate document date and posting date, default system date

concatenate sy-datum0(4) sy-datum4(2) sy-datum+6(2) into lv_docdate.

concatenate sy-datum0(4) sy-datum4(2) sy-datum+6(2) into lv_pstngdate.

  • build structure bapiache08 of RFC BAPI_ACC_GL_POSTING_CHECK

*----


UPDK900880

move: LV_PROFIT_CTR TO lt_bapiache08-comp_code,

  • wa_header-co_code to lt_bapiache08-comp_code,

*----


UPDK900880

'BTUSER' to lt_bapiache08-username,

sy-datum+0(4) to lt_bapiache08-fisc_year,

lv_docdate to lt_bapiache08-doc_date,

lv_pstngdate to lt_bapiache08-pstng_date,

'SA' to lt_bapiache08-doc_type.

  • build structure bapiacgl08 of RFC BAPI_ACC_GL_POSTING_CHECK

loop at lt_acc into wa_acc.

lv_counter = lv_counter + 1.

move: lv_counter to wa_bapiacgl08-itemno_acc,

wa_acc-g_l_acct to wa_bapiacgl08-gl_account,

*----


UPDK900880

  • wa_header-co_code to wa_bapiacgl08-comp_code,

LV_PROFIT_CTR TO wa_bapiacgl08-comp_code,

*----


UPDK900880

lv_pstngdate to wa_bapiacgl08-pstng_date,

'SA' to wa_bapiacgl08-doc_type,

sy-datum+0(4) to wa_bapiacgl08-fisc_year.

if wa_acc-cost_ctr is not initial.

move wa_acc-cost_ctr to wa_bapiacgl08-costcenter.

elseif wa_acc-wbs_elem_e is not initial.

move wa_acc-wbs_elem_e to wa_bapiacgl08-wbs_element.

elseif wa_acc-order_no is not initial.

move wa_acc-order_no to wa_bapiacgl08-orderid.

endif.

append wa_bapiacgl08 to lt_bapiacgl08.

clear wa_bapiacgl08.

lv_counter = lv_counter + 1.

move: lv_counter to wa_bapiacgl08-itemno_acc,

*----


UPDK900880

  • wa_header-co_code to wa_bapiacgl08-comp_code,

LV_PROFIT_CTR TO wa_bapiacgl08-comp_code,

*----


UPDK900880

'0014109889' to wa_bapiacgl08-gl_account,

lv_pstngdate to wa_bapiacgl08-pstng_date,

'SA' to wa_bapiacgl08-doc_type,

sy-datum+0(4) to wa_bapiacgl08-fisc_year.

append wa_bapiacgl08 to lt_bapiacgl08.

clear wa_bapiacgl08.

endloop.

clear lv_counter.

  • build structure bapiaccr08 of RFC BAPI_ACC_GL_POSTING_CHECK

loop at lt_itemdata into wa_itemdata.

lv_counter = lv_counter + 1.

move: lv_counter to wa_bapiaccr08-itemno_acc,

wa_itemdata-value to wa_bapiaccr08-amt_doccur,

'USD' to wa_bapiaccr08-currency.

append wa_bapiaccr08 to lt_bapiaccr08.

clear wa_bapiaccr08.

lv_counter = lv_counter + 1.

move wa_itemdata-value to lv_value.

concatenate lv_value '-' into lv_amount.

move: lv_counter to wa_bapiaccr08-itemno_acc,

lv_amount to wa_bapiaccr08-amt_doccur,

'USD' to wa_bapiaccr08-currency.

append wa_bapiaccr08 to lt_bapiaccr08.

clear wa_bapiaccr08.

endloop.

clear lv_counter.

    • Check the SRM system

IF SY-SYSID = 'UPD'. "3

LV_SYSID = 'UHD_111'.

CONDENSE LV_SYSID NO-GAPS.

ELSEIF SY-SYSID = 'UPX'. "3

LV_SYSID = 'SAPUHD111'.

CONDENSE LV_SYSID NO-GAPS.

ELSEIF SY-SYSID = 'UPQ'. "3

LV_SYSID = 'SAPUHQ100'.

CONDENSE LV_SYSID NO-GAPS.

ELSEIF SY-SYSID = 'UPP'. "3

LV_SYSID = 'SAPUHP100'.

CONDENSE LV_SYSID NO-GAPS.

ENDIF.

  • RFC call

Call Function 'BAPI_ACC_GL_POSTING_CHECK' destination LV_SYSID

Exporting

DOCUMENTHEADER = lt_bapiache08

Tables

ACCOUNTGL = lt_bapiacgl08

CURRENCYAMOUNT = lt_bapiaccr08

RETURN = lt_return.

Loop at lt_return into wa_return.

lv_len = strlen( wa_return-message ).

if lv_len le 49.

move: wa_return to wa_messages-msgty,

'BBP_PD' to wa_messages-msgid,

'047' to wa_messages-msgno,

wa_return-message to wa_messages-msgv1.

append wa_messages to et_messages.

elseif lv_len gt 50 and lv_len le 99.

move: wa_return to wa_messages-msgty,

'BBP_PD' to wa_messages-msgid,

'047' to wa_messages-msgno,

wa_return-message+0(49) to wa_messages-msgv1,

wa_return-message+50(49) to wa_messages-msgv2.

append wa_messages to et_messages.

elseif lv_len ge 100 and lv_len le 149.

move: wa_return to wa_messages-msgty,

'BBP_PD' to wa_messages-msgid,

'047' to wa_messages-msgno,

wa_return-message+0(49) to wa_messages-msgv1,

wa_return-message+50(49) to wa_messages-msgv2,

wa_return-message+100(49) to wa_messages-msgv3.

append wa_messages to et_messages.

elseif lv_len ge 150 and lv_len le 199.

move: wa_return to wa_messages-msgty,

'BBP_PD' to wa_messages-msgid,

'047' to wa_messages-msgno,

wa_return-message+0(49) to wa_messages-msgv1,

wa_return-message+50(49) to wa_messages-msgv2,

wa_return-message+100(49) to wa_messages-msgv3,

wa_return-message+150(49) to wa_messages-msgv4.

append wa_messages to et_messages.

endif.

clear: wa_messages, wa_return.

endloop.

endif.

**************************************************************************************

<b>BADI CODE FOR DOC_CHECK_BADI FOR SCs</b>

*---Declaration

Data: WA_HEADER TYPE BBP_PDS_SC_HEADER_D,

LT_ITEMDATA TYPE TABLE OF BBP_PDS_SC_ITEM_D,

WA_ITEMDATA LIKE LINE OF LT_ITEMDATA,

LT_ACC TYPE TABLE OF BBP_PDS_ACC,

WA_ACC LIKE LINE OF LT_ACC,

lt_bapiache08 type zbapiache08,

lt_bapiacgl08 type table of ZBAPIACGL08,

wa_bapiacgl08 type ZBAPIACGL08,

lt_bapiaccr08 type table of ZBAPIACCR08,

wa_bapiaccr08 type ZBAPIACCR08,

lt_return type table of BAPIRET2,

wa_return type BAPIRET2,

wa_messages type BBP_SMESSAGES_BADI,

lv_docdate(8),

lv_pstngdate(8),

lv_counter type i,

lv_value(15),

lv_amount(16),

lv_len type i,

LV_SYSID(9).

*------Changes for Line item company code

DATA : LV_PROFIT_CTR(4).

*----


Get SC Details

IF ( SY-UCOMM = 'SC_CHECK' AND SY-TCODE = 'BBPSC03' ) OR ( SY-UCOMM = 'SC_ORDER' AND SY-TCODE = 'BBPSC03' ).

CALL FUNCTION 'BBP_PD_SC_GETDETAIL'

EXPORTING

I_GUID = IV_DOC_GUID

  • I_OBJECT_ID =

I_WITH_ITEMDATA = 'X'

IMPORTING

E_HEADER = WA_HEADER

TABLES

E_ITEM = LT_ITEMDATA

E_ACCOUNT = LT_ACC

.

  • Concatenate document date and posting date, default system date

  • concatenate sy-datum6(2) sy-datum0(4) sy-datum+4(2) into lv_docdate.

  • concatenate sy-datum6(2) sy-datum0(4) sy-datum+4(2) into lv_pstngdate.

concatenate sy-datum0(4) sy-datum4(2) sy-datum+6(2) into lv_docdate.

concatenate sy-datum0(4) sy-datum4(2) sy-datum+6(2) into lv_pstngdate.

  • build structure bapiache08 of RFC BAPI_ACC_GL_POSTING_CHECK

*----


*loop at LT_ITEMDATA into wa_ITEMDATA.

  • move wa_itemdata-BE_CO_CODE to lt_bapiache08-comp_code.

*endloop.

LOOP AT LT_ACC INTO WA_ACC.

MOVE WA_ACC-PROFIT_CTR+0(4) TO LV_PROFIT_CTR.

ENDLOOP.

*----


*----


Chnages for Line item company code

move: LV_PROFIT_CTR TO lt_bapiache08-comp_code,

  • wa_header-co_code to lt_bapiache08-comp_code,

*----


End of Chnages for Line item company code

'BTUSER' to lt_bapiache08-username,

sy-datum+0(4) to lt_bapiache08-fisc_year,

lv_docdate to lt_bapiache08-doc_date,

lv_pstngdate to lt_bapiache08-pstng_date,

'SA' to lt_bapiache08-doc_type.

  • build structure bapiacgl08 of RFC BAPI_ACC_GL_POSTING_CHECK

loop at lt_acc into wa_acc.

lv_counter = lv_counter + 1.

move: lv_counter to wa_bapiacgl08-itemno_acc,

wa_acc-g_l_acct to wa_bapiacgl08-gl_account,

*----


Chnages for Line item company code

  • wa_header-co_code to wa_bapiacgl08-comp_code,

LV_PROFIT_CTR TO wa_bapiacgl08-comp_code,

*----


End of Chnages for Line item company code

lv_pstngdate to wa_bapiacgl08-pstng_date,

'SA' to wa_bapiacgl08-doc_type,

sy-datum+0(4) to wa_bapiacgl08-fisc_year.

if wa_acc-cost_ctr is not initial.

move wa_acc-cost_ctr to wa_bapiacgl08-costcenter.

elseif wa_acc-wbs_elem_e is not initial.

move wa_acc-wbs_elem_e to wa_bapiacgl08-wbs_element.

elseif wa_acc-order_no is not initial.

move wa_acc-order_no to wa_bapiacgl08-orderid.

endif.

append wa_bapiacgl08 to lt_bapiacgl08.

clear wa_bapiacgl08.

lv_counter = lv_counter + 1.

move: lv_counter to wa_bapiacgl08-itemno_acc,

*----


Chnages for Line item company code

  • wa_header-co_code to wa_bapiacgl08-comp_code,

LV_PROFIT_CTR TO wa_bapiacgl08-comp_code,

*----


End of Chnages for Line item company code

'0014109889' to wa_bapiacgl08-gl_account,

lv_pstngdate to wa_bapiacgl08-pstng_date,

'SA' to wa_bapiacgl08-doc_type,

sy-datum+0(4) to wa_bapiacgl08-fisc_year.

append wa_bapiacgl08 to lt_bapiacgl08.

clear wa_bapiacgl08.

endloop.

clear lv_counter.

  • build structure bapiaccr08 of RFC BAPI_ACC_GL_POSTING_CHECK

loop at lt_itemdata into wa_itemdata.

lv_counter = lv_counter + 1.

move: lv_counter to wa_bapiaccr08-itemno_acc,

wa_itemdata-value to wa_bapiaccr08-amt_doccur,

'USD' to wa_bapiaccr08-currency.

append wa_bapiaccr08 to lt_bapiaccr08.

clear wa_bapiaccr08.

lv_counter = lv_counter + 1.

move wa_itemdata-value to lv_value.

concatenate lv_value '-' into lv_amount.

move: lv_counter to wa_bapiaccr08-itemno_acc,

lv_amount to wa_bapiaccr08-amt_doccur,

'USD' to wa_bapiaccr08-currency.

append wa_bapiaccr08 to lt_bapiaccr08.

clear wa_bapiaccr08.

endloop.

clear lv_counter.

    • Check the SRM system

IF SY-SYSID = 'UPD'. "3

LV_SYSID = 'UHD_111'.

CONDENSE LV_SYSID NO-GAPS.

ELSEIF SY-SYSID = 'UPX'. "3

LV_SYSID = 'SAPUHD111'.

CONDENSE LV_SYSID NO-GAPS.

ELSEIF SY-SYSID = 'UPQ'. "3

LV_SYSID = 'SAPUHQ100'.

CONDENSE LV_SYSID NO-GAPS.

ELSEIF SY-SYSID = 'UPP'. "3

LV_SYSID = 'SAPUHP100'.

CONDENSE LV_SYSID NO-GAPS.

ENDIF.

  • RFC call

Call Function 'BAPI_ACC_GL_POSTING_CHECK' destination LV_SYSID

Exporting

DOCUMENTHEADER = lt_bapiache08

Tables

ACCOUNTGL = lt_bapiacgl08

CURRENCYAMOUNT = lt_bapiaccr08

RETURN = lt_return.

  • break-point.

Loop at lt_return into wa_return.

lv_len = strlen( wa_return-message ).

if lv_len le 49.

move: wa_return to wa_messages-msgty,

'BBP_PD' to wa_messages-msgid,

'047' to wa_messages-msgno,

wa_return-message to wa_messages-msgv1.

append wa_messages to et_messages.

elseif lv_len gt 50 and lv_len le 99.

move: wa_return to wa_messages-msgty,

'BBP_PD' to wa_messages-msgid,

'047' to wa_messages-msgno,

wa_return-message+0(49) to wa_messages-msgv1,

wa_return-message+50(49) to wa_messages-msgv2.

append wa_messages to et_messages.

elseif lv_len ge 100 and lv_len le 149.

move: wa_return to wa_messages-msgty,

'BBP_PD' to wa_messages-msgid,

'047' to wa_messages-msgno,

wa_return-message+0(49) to wa_messages-msgv1,

wa_return-message+50(49) to wa_messages-msgv2,

wa_return-message+100(49) to wa_messages-msgv3.

append wa_messages to et_messages.

elseif lv_len ge 150 and lv_len le 199.

move: wa_return to wa_messages-msgty,

'BBP_PD' to wa_messages-msgid,

'047' to wa_messages-msgno,

wa_return-message+0(49) to wa_messages-msgv1,

wa_return-message+50(49) to wa_messages-msgv2,

wa_return-message+100(49) to wa_messages-msgv3,

wa_return-message+150(49) to wa_messages-msgv4.

append wa_messages to et_messages.

endif.

clear: wa_messages, wa_return.

endloop.

endif.

*******************************************************************************

This is what i wrote in BADI except this i wrote nothing ...and no where

Former Member
0 Kudos

Hi

I checked your code pasted above...

I checked that for this BAPI the Account type (KOART) field has following fixed values

A Assets

D Customers

K Vendors

M Material

S G/L accounts

Point 1 to notice is that the How this 'V' A/c type is coming in the BAPI Error... ?

----


Point 2 to notice is that the BAPI - BAPI_ACC_GL_POSTING_CHECK

uses the key in the form of this way.

If an accounting document is posted via the interface in Accounting, the sending application transfers a unique reference. It consists of object key and object type. The object key consists of a reference document number and a reference organizational unit.

Example: 1000007899 00011996

Reference Reference organizational unit

document no. client and fiscal year

The object type contains a note on storing the original document.

----


Hope this will help.

Please reward full points, incase it suits your requirements.

Regards

- Atul

Former Member
0 Kudos

Thank you Atul!

I have deactivated all active implemenatations..and checked whether the error is coming..<b>YES the error still coming</b> ...so this must be from the standard functionality..BUT how to know from where exactly this error is coming..

Please help