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

hoe to get data from basic list

Former Member
0 Likes
425

Hi,

I have a requirement that, there are records in basic list about customer,after selecting the records from the basic list. run a transaction XD06 for this records using bdc, how to get these selected records into a internal table to run a bdc.

Regards & Thanks

sai

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
404

hi,

u need to write code in user_command.

U using ALV?

Than here is code.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = 'ZALV_PRDS'

i_callback_user_command = <b>'USER_COMMAND'</b>

it_fieldcat = t_fcat

i_save = 'A'

it_events = t_eve

TABLES

t_outtab = itab

  • EXCEPTIONS

  • PROGRAM_ERROR = 1

  • OTHERS = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

FORM user_command USING u_com LIKE sy-ucomm sel_field TYPE slis_selfield.

CASE u_com.

WHEN '&IC1'.

IF sel_field-fieldname = 'MATNR'.

READ TABLE itab INDEX sel_field-tabindex.

IF sy-subrc = 0.

t_mat = itab-matnr.

SET PARAMETER ID 'MAT' FIELD t_mat.

CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.

ENDIF.

ENDIF.

ENDCASE.

ENDFORM. "user_command

Here i am retrieving selected matnr into t_mat...and using it i am calling 'MM03'.

U have to give customer no into XD06 to skip first screen.

For this u have to find parameter ID ( Find through Technical Info), in this case it is KUN so u have to use KUN in place of MAT...

reward me back if not clear

2 REPLIES 2
Read only

Former Member
0 Likes
404

hi,

try this simple program, use the same logic.

DATA: g_number TYPE i VALUE 10,

line_num TYPE i.

START-OF-SELECTION.

SET PF-STATUS 'NIYAZ'.

WRITE:/ g_number INPUT ON.

AT USER-COMMAND.

CASE sy-ucomm.

WHEN 'SUBMIT'.

line_num = sy-lilli.

READ LINE line_num FIELD VALUE g_number.

WRITE:/ 'the changed value is ', g_number.

ENDCASE.

reward points if useful,

Regards,

Niyaz

Read only

Former Member
0 Likes
405

hi,

u need to write code in user_command.

U using ALV?

Than here is code.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = 'ZALV_PRDS'

i_callback_user_command = <b>'USER_COMMAND'</b>

it_fieldcat = t_fcat

i_save = 'A'

it_events = t_eve

TABLES

t_outtab = itab

  • EXCEPTIONS

  • PROGRAM_ERROR = 1

  • OTHERS = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

FORM user_command USING u_com LIKE sy-ucomm sel_field TYPE slis_selfield.

CASE u_com.

WHEN '&IC1'.

IF sel_field-fieldname = 'MATNR'.

READ TABLE itab INDEX sel_field-tabindex.

IF sy-subrc = 0.

t_mat = itab-matnr.

SET PARAMETER ID 'MAT' FIELD t_mat.

CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.

ENDIF.

ENDIF.

ENDCASE.

ENDFORM. "user_command

Here i am retrieving selected matnr into t_mat...and using it i am calling 'MM03'.

U have to give customer no into XD06 to skip first screen.

For this u have to find parameter ID ( Find through Technical Info), in this case it is KUN so u have to use KUN in place of MAT...

reward me back if not clear