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

Problem in calling multiple records to edit.

Former Member
0 Likes
467

HI Experts,

I am using check box in list , when i clicked on select all button all the check box are selected and i want to update these records

when i press update button it should call the transaction 'MM02' and all the material numbers should be displayed one afterr the other

till the selected records are completed, means after editing first record and then saving that particular record then next selected material number should be displayed on 'MM02' screen .

I am trying with this code but iam not geting proper output.

case 'sy-ucomm'.

when 'updat'.

do.

read line lno field tab_final-flag = 'x'.

if sy-subrc <> 0.

exit.

endif.

if tab_final-flag = 'x'.

loop at tab_final where tab_final-flag = 'x'.

set parameter id 'MAT' field fval.

call transaction 'MM02' .

endloop.

lno = lno + 1.

enddo.

Points will be rewarded.

Thannks & Regards.

Francis Reddy

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
437

Hi Francis,

Refer this code :

CASE sy-ucomm.

WHEN 'UPDATE'.

DO .

READ LINE SY-INDEX FIELD VALUE CHK_BOX I_TAB-VBELN

I_TAB-POSNR. "READING LINES FROM THE BASIC LIST

IF SY-SUBRC <> 0.

EXIT.

ENDIF.

IF CHK_BOX = 'X'.

SET PARAMETER ID 'AUN' FIELD I_TAB-VBELN.

SET PARAMETER ID 'APO' FIELD I_TAB-POSNR.

CALL TRANSACTION

perform bdc_dynpro1 using 'SAPMV45A' '0102'.

perform bdc_field1 using 'BDC_CURSOR'

'mara-matnr'.

perform bdc_field1 using 'BDC_OKCODE'

'/00'.

perform bdc_field1 using 'mara-matnr'

I_TAB-matnr.

PERFORM BDC_TRANSACTION1 USING 'mm02'.

ENDFORM. " Z8HG_TRNS_BDC

&----


*& Form bdc_dynpro1

&----


  • text

----


  • -->P_0731 text

  • -->P_0732 text

----


FORM bdc_dynpro1 USING PROGRAM DYNPRO.

CLEAR BDCDATA.

BDCDATA-PROGRAM = PROGRAM.

BDCDATA-DYNPRO = DYNPRO.

BDCDATA-DYNBEGIN = 'X'.

APPEND BDCDATA.

ENDFORM. " bdc_dynpro1

&----


*& Form bdc_field1

&----


  • text

----


  • -->P_0736 text

  • -->P_0737 text

----


FORM bdc_field1 USING FNAM FVAL.

CLEAR BDCDATA.

BDCDATA-FNAM = FNAM.

BDCDATA-FVAL = FVAL.

APPEND BDCDATA.

ENDFORM. " bdc_field1

&----


*& Form BDC_TRANSACTION1

&----


  • text

----


  • -->P_0848 text

----


FORM BDC_TRANSACTION1 USING TCODE.

CALL TRANSACTION TCODE USING BDCDATA MODE 'E' .

ENDFORM. " BDC_TRANSACTION1

Reward points if helpful.

Regards,

Hemant

HI Experts,

I am using check box in list , when i clicked on select all button all the check box are selected and i want to update these records

when i press update button it should call the transaction 'MM02' and all the material numbers should be displayed one afterr the other

till the selected records are completed, means after editing first record and then saving that particular record then next selected material number should be displayed on 'MM02' screen .

I am trying with this code but iam not geting proper output.

case 'sy-ucomm'.

when 'updat'.

do.

read line lno field tab_final-flag = 'x'.

if sy-subrc <> 0.

exit.

endif.

if tab_final-flag = 'x'.

loop at tab_final where tab_final-flag = 'x'.

set parameter id 'MAT' field fval.

call transaction 'MM02' .

endloop.

lno = lno + 1.

enddo.

Points will be rewarded.

Thannks & Regards.

Francis Reddy

2 REPLIES 2
Read only

Former Member
0 Likes
438

Hi Francis,

Refer this code :

CASE sy-ucomm.

WHEN 'UPDATE'.

DO .

READ LINE SY-INDEX FIELD VALUE CHK_BOX I_TAB-VBELN

I_TAB-POSNR. "READING LINES FROM THE BASIC LIST

IF SY-SUBRC <> 0.

EXIT.

ENDIF.

IF CHK_BOX = 'X'.

SET PARAMETER ID 'AUN' FIELD I_TAB-VBELN.

SET PARAMETER ID 'APO' FIELD I_TAB-POSNR.

CALL TRANSACTION

perform bdc_dynpro1 using 'SAPMV45A' '0102'.

perform bdc_field1 using 'BDC_CURSOR'

'mara-matnr'.

perform bdc_field1 using 'BDC_OKCODE'

'/00'.

perform bdc_field1 using 'mara-matnr'

I_TAB-matnr.

PERFORM BDC_TRANSACTION1 USING 'mm02'.

ENDFORM. " Z8HG_TRNS_BDC

&----


*& Form bdc_dynpro1

&----


  • text

----


  • -->P_0731 text

  • -->P_0732 text

----


FORM bdc_dynpro1 USING PROGRAM DYNPRO.

CLEAR BDCDATA.

BDCDATA-PROGRAM = PROGRAM.

BDCDATA-DYNPRO = DYNPRO.

BDCDATA-DYNBEGIN = 'X'.

APPEND BDCDATA.

ENDFORM. " bdc_dynpro1

&----


*& Form bdc_field1

&----


  • text

----


  • -->P_0736 text

  • -->P_0737 text

----


FORM bdc_field1 USING FNAM FVAL.

CLEAR BDCDATA.

BDCDATA-FNAM = FNAM.

BDCDATA-FVAL = FVAL.

APPEND BDCDATA.

ENDFORM. " bdc_field1

&----


*& Form BDC_TRANSACTION1

&----


  • text

----


  • -->P_0848 text

----


FORM BDC_TRANSACTION1 USING TCODE.

CALL TRANSACTION TCODE USING BDCDATA MODE 'E' .

ENDFORM. " BDC_TRANSACTION1

Reward points if helpful.

Regards,

Hemant

Read only

rodrigo_paisante3
Active Contributor
0 Likes
437

Hi Francis,

try the fm get_selected_rows. This fm return a the selected rows in Internal Table. It can help you?

regards,

Paisante