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

BAPI_AGREEMENTS - error

Former Member
0 Likes
985

Hi all,

I am using the Std BAPI

BAPI_AGREEMENTS to create the rebate agreements. But it is throwing an error as follows.

Internal error: agreement initial

How can i resolve this issue ? Am i missing any other parameters.......

For your reference i am pasting the code too.......................

data: it_BAPI_AGREEMENTS type table of BAPIAGRMNT WITH HEADER LINE.

data: it_BAPIRET2 type table of BAPIRET2 with header line.

data: it_BAPIKNUMAS type table of BAPIKNUMAS with header line.

start-of-selection.

it_BAPI_AGREEMENTS-SALES_ORG = 'MXCO'.

it_BAPI_AGREEMENTS-DISTR_CHAN = '20'.

it_BAPI_AGREEMENTS-DIVISION = 'TV'.

it_BAPI_AGREEMENTS-AGR_TYPE = 'ZA62'.

it_BAPI_AGREEMENTS-RECIPIENT = '31300'.

it_BAPI_AGREEMENTS-AGRMT_CURR = 'MXN'.

it_BAPI_AGREEMENTS-VALID_FROM = '08062008'.

it_BAPI_AGREEMENTS-VALID_TO = '30602008'.

it_BAPI_AGREEMENTS-OPERATION = '009'.

it_BAPI_AGREEMENTS-CATEGORY = 'A'.

it_BAPI_AGREEMENTS-APPLICATIO = 'V'.

append it_BAPI_AGREEMENTS.

CALL FUNCTION 'BAPI_AGREEMENTS'

  • EXPORTING

  • PI_INITIALMODE =

  • PI_BLOCKNUMBER =

TABLES

ti_bapiagrmnt = it_BAPI_AGREEMENTS

to_bapiret2 = it_BAPIRET2

to_bapiknumas = it_BAPIKNUMAS

EXCEPTIONS

UPDATE_ERROR = 1

OTHERS = 2

.

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

else.

read table it_bapiret2 index 1.

if sy-subrc eq 0.

write:/ it_bapiret2-MESSAGE.

endif.

ENDIF.

Regards,

Venkatesh

6 REPLIES 6
Read only

Former Member
0 Likes
776

Date should be passed in format YYYYMMDD

Try this

Read only

0 Likes
776

HI,

i am getting the same problem. Actually that it is not a problem as of now. But any how i have changed the format of date. and still the same.

Regards,

Venkatesh.

Read only

Former Member
0 Likes
776

Hello

Are you sure that date is correct ?

it_BAPI_AGREEMENTS-VALID_TO = '30602008'.

Read only

0 Likes
776

HI,

it_BAPI_AGREEMENTS-VALID_FROM = '20080608'.

it_BAPI_AGREEMENTS-VALID_TO = '20080630'.

these are the dates i am giving in my code.

Regards,

Venkatesh.

Read only

Former Member
0 Likes
776

HI,

Any remarks on this post please .......

regards,

Venkatesh

Read only

Former Member
776

Hi,

Please use AGREE_COND = $00001 along with other details, it works. Let me know if you still face any issues.

Regards,

Shanth