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 to update KONP table (tcode: WYP2)

Former Member
0 Likes
4,664

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

2 REPLIES 2
Read only

Former Member
0 Likes
2,032

Hi,

Check the following thread...

KR

Veeranji Reddy P.

Read only

Former Member
0 Likes
2,032

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.