‎2010 Aug 10 2:06 PM
Hi all,
I am looking for a BAPI which can update UoM field through tranaction WYP3 (pricing condition). I found one BAPI ( BAPI_PRICES_CONDITIONS ) but as it not released, cannot be used. Can you please suggest any BAPI's available
for updating ( table KONP ) the transaction.
Regards,
John
‎2010 Aug 10 2:30 PM
‎2015 Nov 19 6:05 PM
Use function CND_PRICES_DETAILS_SAVE.
All the tables are required to be passed to the function but they can be left blank.
Select * from KONP to get data and modify fields needed.
Sample code is below:
"Local Internal Table Declarations
DATA: lt_konhdb TYPE STANDARD TABLE OF konhdb,
lt_konpdb TYPE STANDARD TABLE OF konpdb,
lt_konm_staf TYPE STANDARD TABLE OF condscale.
"Local Structure Declarations
DATA: lx_konpdb TYPE konpdb.
"Local Field Symbol Declarations
FIELD-SYMBOLS: <lx_konp> TYPE konp.
"Local Constant Declarations
CONSTANTS: lc_update TYPE updkz_d VALUE 'U'.
"Check for Condition Records
IF gt_konp IS INITIAL.
RETURN. "Exit
ENDIF.
"Build Update Records
LOOP AT gt_konp ASSIGNING <lx_konp>.
MOVE <lx_konp> TO lx_konpdb.
MOVE lc_update TO lx_konpdb-updkz.
APPEND lx_konpdb TO lt_konpdb.
CLEAR lx_konpdb.
ENDLOOP.
"Save Updates to KONP Table
CALL FUNCTION 'CND_PRICES_DETAILS_SAVE'
TABLES
db_xkonh = lt_konhdb
db_xkonp = lt_konpdb
db_xstaf = lt_konm_staf
EXCEPTIONS
OTHERS = 1.
IF sy-subrc = 0.
COMMIT WORK AND WAIT.
"Output Success Message
MESSAGE text-s01 TYPE 'I' DISPLAY LIKE 'S'.
ELSE.
"Output Error Message
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.