Application Development 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: 

Problem in pp02 bdc

Former Member
0 Kudos
374

Hi all,

I have developed bdc for pp02.while uploading data first record getting uploaded successfully,but for second line earlier record getting changed.I want to clear first record created which is appearing on pp02 first screen.so, that record will not get overwritten.can anyone help me out to clear object id created from screen.

Thanks in advance.

Regards,

Sheela Patil

7 REPLIES 7

Former Member
0 Kudos
179

Hi,

Here i am placing sample code, how to clear record after successfully loaded, check with this code where to clear the record.

TYPES: BEGIN OF TY_DATA,

MATNR TYPE MATNR,

MBRSH TYPE MBRSH,

MTART TYPE MTART,

MAKTX TYPE MAKTX,

MEINS TYPE MEINS,

END OF TY_DATA.

DATA IT_DATA TYPE TABLE OF TY_DATA WITH HEADER LINE.

DATA IT_BDC TYPE TABLE OF BDCDATA WITH HEADER LINE.

*--MAIN PROGRAM

START-OF-SELECTION.

PERFORM GET_DATA.

PERFORM UPLOAD.

*--SUBROUTINE FOR GET_DATA

FORM GET_DATA.

DATA STR1 TYPE IBIPPARMS-PATH.

DATA STR2 TYPE STRING.

CALL FUNCTION 'F4_FILENAME'

IMPORTING

FILE_NAME = STR1.

STR2 = STR1.

.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = STR2

  • FILETYPE = 'ASC'

HAS_FIELD_SEPARATOR = 'X'

TABLES

DATA_TAB = IT_DATA[].

ENDFORM.

*--SUBROUTINE FOR BDC_DYNPRO

FORM BDC_DYNPRO USING PNAME SNO.

IT_BDC-PROGRAM = PNAME.

IT_BDC-DYNPRO = SNO.

IT_BDC-DYNBEGIN = 'X'.

APPEND IT_BDC.

CLEAR IT_BDC.

ENDFORM.

*--SUBROTINE FOR BDC_FIELD

FORM BDC_FIELD USING FNAME FVALUE.

IT_BDC-FNAM = FNAME.

IT_BDC-FVAL = FVALUE.

APPEND IT_BDC.

CLEAR IT_BDC.

ENDFORM.

*--SUBROUTINE FOR UPLOAD.

FORM UPLOAD.

CALL FUNCTION 'BDC_OPEN_GROUP'

EXPORTING

CLIENT = SY-MANDT

GROUP = 'RAVI'

HOLDDATE = '20130101'

KEEP = 'X'

USER = SY-UNAME.

LOOP AT IT_DATA.

PERFORM BUILD_BDC.

CALL FUNCTION 'BDC_INSERT'.

  • EXPORTING

TCODE = 'MM01'

TABLES

DYNPROTAB = IT_BDC[].

*CALL TRANSACTION 'MM01' USING IT_BDC MODE 'N' UPDATE 'A'.

*modes : A -> all screens, N -> no screens, E -> error screens.

*update : S -> sychrnous A -> asynchronous, L -> local

REFRESH IT_BDC.

ENDLOOP.

CALL FUNCTION 'BDC_CLOSE_GROUP'.

ENDFORM.

*--SUBROUTINE FOR BUILD_BDC

FORM BUILD_BDC.

*SCREEN 1

perform bdc_dynpro using 'SAPLMGMM' '0060'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'RMMG1-MATNR'

IT_DATA-MATNR.

perform bdc_field using 'RMMG1-MBRSH'

IT_DATA-MBRSH.

perform bdc_field using 'RMMG1-MTART'

IT_DATA-MTART.

*SCREEN 2

perform bdc_dynpro using 'SAPLMGMM' '0070'.

perform bdc_field using 'BDC_OKCODE'

'=ENTR'.

perform bdc_field using 'MSICHTAUSW-KZSEL(01)'

'X'.

*SCREEN 3

perform bdc_dynpro using 'SAPLMGMM' '4004'.

perform bdc_field using 'BDC_OKCODE'

'=BU'.

perform bdc_field using 'MAKT-MAKTX'

IT_DATA-MAKTX.

perform bdc_field using 'MARA-MEINS'

IT_DATA-MEINS.

perform bdc_field using 'MARA-MTPOS_MARA'

'NORM'.

ENDFORM.

regards,

Ravi

madhu_vadlamani
Active Contributor
0 Kudos
179

Hi Sheela,

Why can not you try with fm.Please check with RH_PNNNN_MAINTAIN .

Regards,

Madhu.

0 Kudos
179

Hi Madhu,

I am using this function module for first time.if you have used it earlier please help to use it in my case.how I can create multiple records for 1000 and 1001 infotypes.Thanks for Quick response.

Regards,

Sheela Patil

0 Kudos
179

Hi all,

I am trying to use this function module but not able to update data into database tables.while passing data function module is getting stuck on pp02 object maintenance screen.I am not able to proceed further automatically.can anyone help me out to resolve this issue.

Thanks in advance.

Regards,

Sheela Patil

0 Kudos
179

Hi all,

Any answers please!! I tried using RH_INSERT_INFTY function module also, but I am getting return code as SY-SUBRC = 1.NO Authorization error.how to clear this error.

Please reply.

Regards,

Sheela Patil

0 Kudos
179

Hi all,

Thanks for quick replies.my issue is resolved.I used parameter id 'PON' to remove object id generated while maintaining multiple data for Infotype 1000 and 1001.

Regards,

Sheela Patil

Former Member
0 Kudos
179

Problem is solved as mentioned in earlier message thread.