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

Former Member
0 Likes
656

Hi friends,

I am trying to upload CatalogGroups and their corresponding Codes(TCode:QS42) using BAPI_QPGR_SAVEREPLICA. Suppose if there are already 0001 to 0007 codes for a particular Catalog and CatalogGroup, when I call this bapi for uploading 0008 and 0009 codes, Bapiret2 gives me a error message saying 'cannot delete 0001....0007'. I tried using the functions-004,009,007 etc.

Here is the sample code I wrote, please let me know your suggestions.Thanks in advance.

DATA: GT_BAPIQPGR_QPGR TYPE BAPIQPGR_QPGR OCCURS 0 WITH HEADER LINE,

GT_BAPIQPGR_QPGT TYPE BAPIQPGR_QPGT OCCURS 0 WITH HEADER LINE,

GT_BAPIQPGR_QPCD TYPE BAPIQPGR_QPCD OCCURS 0 WITH HEADER LINE,

GT_BAPIQPGR_QPCT TYPE BAPIQPGR_QPCT OCCURS 0 WITH HEADER LINE,

GT_BAPIRET2 TYPE BAPIRET2 OCCURS 0 WITH HEADER LINE.

GT_BAPIQPGR_QPGR-FUNCTION = '004'.

GT_BAPIQPGR_QPGR-CAT_TYPE = 'Q'.

GT_BAPIQPGR_QPGR-CODE_GROUP = 'VM'.

GT_BAPIQPGR_QPGR-STATUS = '2'.

APPEND GT_BAPIQPGR_QPGR.

GT_BAPIQPGR_QPGT-LANGU = 'EN'.

GT_BAPIQPGR_QPGT-SHORT_TEXT = 'Vending Machine'.

APPEND GT_BAPIQPGR_QPGT.

GT_BAPIQPGR_QPCD-CODE = '0008'.

*GT_BAPIQPGR_QPCD-IND_USED = 'X'.

APPEND GT_BAPIQPGR_QPCD.

GT_BAPIQPGR_QPCD-CODE = '0009'.

*GT_BAPIQPGR_QPCD-IND_USED = 'X'.

APPEND GT_BAPIQPGR_QPCD.

GT_BAPIQPGR_QPCT-CODE = '0008'.

GT_BAPIQPGR_QPCT-LANGU = 'EN'.

GT_BAPIQPGR_QPCT-SHORT_TEXT = 'VMBDWSCGC'.

APPEND GT_BAPIQPGR_QPCT.

GT_BAPIQPGR_QPCT-CODE = '0009'.

GT_BAPIQPGR_QPCT-LANGU = 'EN'.

GT_BAPIQPGR_QPCT-SHORT_TEXT = 'VMBDWSCGAC'.

APPEND GT_BAPIQPGR_QPCT.

CALL FUNCTION 'BAPI_QPGR_SAVEREPLICA'

EXPORTING

I_CODE_GROUP = GT_BAPIQPGR_QPGR

TABLES

CODE_GRP_SHORTTEXTTAB = GT_BAPIQPGR_QPGT

  • CODE_GRP_LONGTEXTTAB =

CODES_OF_CODE_GRP = GT_BAPIQPGR_QPCD

CODE_SHORTTEXTTAB = GT_BAPIQPGR_QPCT

  • CODE_LONGTEXTTAB =

RETURN = GT_BAPIRET2

  • EXTENSION1 =

.

WRITE:/ GT_BAPIRET2-TYPE.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

  • EXPORTING

  • WAIT =

IMPORTING

RETURN = GT_BAPIRET2.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
570

Hi ,

u have to use BAPIS for update / Change .try list of BAPI avail for this.

<b>LQPGRUXX</b>: check this Program

Regards

Prabhu

2 REPLIES 2
Read only

Former Member
0 Likes
571

Hi ,

u have to use BAPIS for update / Change .try list of BAPI avail for this.

<b>LQPGRUXX</b>: check this Program

Regards

Prabhu

Read only

0 Likes
570

Hi Friends,

I tried sending all the codes again from 0001 to 0009 (not just 0008 and 0009)in an itab and assigned to the bapi parameter.And I used '004' Function.It worked.

Anyways,thanks for trying to solve this problem,Prabhu.

Cheers,

Dev Reddy