Skip to Content
0
Former Member
Feb 14, 2007 at 10:05 AM

BAPI_PRICES_CONDITIONS

205 Views

I have implemented a code based on some code samples about BAPI_PRICES_CONDITIONS in this forum but it doesn't work.

It doesn't return any error but doesn't create any reg condition.

Any help? My code:

wtabla1-table_no = my-kotabnr.

wtabla1-applicatio = 'V'.

wtabla1-cond_type = my-kschl.

wtabla1-operation = '009'.

wtabla1-varkey = g_vakey.

wtabla1-valid_to = my-datbi.

wtabla1-valid_from = my-datab.

wtabla1-cond_no = knumh_new.

APPEND wtabla1 TO tabla1.

wtabla2-operation = '009'.

wtabla2-cond_no = knumh_new.

wtabla2-created_by = sy-uname.

wtabla2-creat_date = sy-datum.

wtabla2-cond_usage = 'A'.

wtabla2-table_no = my-kotabnr.

wtabla2-applicatio = 'V'.

wtabla2-cond_type = my-kschl.

wtabla2-varkey = g_vakey.

wtabla2-valid_from = my-datab.

wtabla2-valid_to = my-datbi..

APPEND wtabla2 TO tabla2.

wtabla3-operation = '009'.

wtabla3-cond_no = knumh_new.

wtabla3-cond_count = my-kopos.

wtabla3-applicatio = 'V'.

wtabla3-cond_type = my-kschl.

wtabla3-scaletype = my-stfkz.

wtabla3-scalebasin = my-kzbzg.

wtabla3-scale_qty = my-kstbm.

wtabla3-cond_p_unt = my-kpein.

wtabla3-cond_unit = my-kmein.

wtabla3-calctypcon = my-krech.

wtabla3-cond_value = my-kbetr.

wtabla3-condcurr = my-konwa.

APPEND wtabla3 TO tabla3.

CALL FUNCTION 'BAPI_PRICES_CONDITIONS'

  • EXPORTING

  • PI_INITIALMODE = ' '

  • PI_BLOCKNUMBER =

TABLES

ti_bapicondct = tabla1

ti_bapicondhd = tabla2

ti_bapicondit = tabla3

ti_bapicondqs = tabla4

ti_bapicondvs = tabla5

to_bapiret2 = tabla6

to_bapiknumhs = tabla7

to_mem_initial = tabla8

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.

ENDIF.

READ TABLE tabla6 WITH KEY type = 'E' TRANSPORTING NO FIELDS.

IF sy-subrc = 0.

LOOP AT tabla6 INTO wtabla6.

WRITE: / wtabla6-type, wtabla6-message, wtabla6-id,

wtabla6-log_no, wtabla6-log_msg_no,

wtabla6-message_v1, wtabla6-message_v2,

wtabla6-message_v3, wtabla6-message_v4,

wtabla6-parameter,wtabla6-row,wtabla6-field.

ENDLOOP.

ELSE.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

*EXPORTING

  • WAIT =

IMPORTING

return = wtabla6.

ENDIF.