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: 

call transaction using bdc

Former Member
0 Kudos

Dear friends,

I have a program displaying the alv list report,

by selecting the line in the alv list report, i need to call another tranaction

and the values in the alv list is to be populated in the new transaction fields.

i have to use Call Transaction using bdc,

please , show me the logic and the code

Thanks and Regards

karthik

6 REPLIES 6

Former Member
0 Kudos

Hi kalimuthu,

1. by selecting the line in the alv list report, i need to call another tranaction

I don't think BDC for such action,

is possible.

2. BCOS in alv, probalby,

we cannot set the selected line, thru code.

regards,

amit m.

former_member186741
Active Contributor
0 Kudos

you need to ater for this in the user_command event.

1. associate the event with a form

  • set up User Command event

PERFORM setup_alv_event

USING slis_ev_user_command 'USER_COMMAND'

CHANGING t_events[].

FORM setup_alv_event

USING i_event_name TYPE slis_formname

i_form_name TYPE slis_formname

CHANGING it_event TYPE slis_t_event.

DATA:

ls_event TYPE slis_alv_event.

ls_event-name = i_event_name.

ls_event-form = i_form_name.

APPEND ls_event TO it_event.

ENDFORM. " SETUP__alv_event

2. write the form referred to above

FORM user_command

USING i_ucomm LIKE sy-ucomm

i_selfield TYPE slis_selfield.

CASE i_selfield-fieldname.

  • billing document number....

WHEN 'VBELN'.

*... jump to display delivery transaction

SET PARAMETER ID 'VL' FIELD i_selfield-value.

CALL TRANSACTION 'VL03N' AND SKIP FIRST SCREEN.

  • fi document number...

WHEN 'BELNR' OR 'BELNR_PV' OR 'NEW_DOC'.

  • Dont do it if the docno is empty

CHECK NOT i_selfield-value IS INITIAL.

READ TABLE t_detail INDEX i_selfield-tabindex.

SET PARAMETER ID 'BLN' FIELD i_selfield-value.

SET PARAMETER ID 'GJR' FIELD t_detail-gjahr.

SET PARAMETER ID 'BUK' FIELD p_bukrs.

*... jump to display the FI doc transaction

CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.

ENDCASE.

ENDFORM. " USER_COMMAND

3. this is a simple example to display documents but you could have more complex bdc code if necessary. Have a look at the TYPE slis_selfield(in type group SLIS) to see what data is available to you.

0 Kudos

Dear neil,

Thank for the logic,i am already using the 'USER Command' logic .

i am able to diaplay the transaction but in the new traction i need to post the values in the particulat fields.

In spec it is mentioned to use 'CALL Transaction using BDC

0 Kudos

Hi,

Check SAP help For 'CALL TRANSACTION'.

Here you have to fill internal table with program name and screen name as one record and other actions as separate lines. You will get messages back as internal table.

All variations documented very well.

DATA: BDCDATA TYPE TABLE OF <b>BDCDATA</b>.

DATA: ITAB TYPE TABLE OF <b>BDCMSGCOLL</b>.

DATA: PROGRAM LIKE SY-REPID,

WA_BDCDATA TYPE BDCDATA.

WA_BDCDATA-PROGRAM = 'SAPMS38M'.

WA_BDCDATA-DYNPRO = '0100'.

<b>WA_BDCDATA-DYNBEGIN = 'X'.</b>

APPEND WA_BDCDATA TO BDCDATA.

CLEAR WA_BDCDATA.

WA_BDCDATA-FNAM = 'RS38M-PROGRAMM'.

WA_BDCDATA-FVAL = PROGRAM.

APPEND WA_BDCDATA TO BDCDATA.

...

CALL TRANSACTION 'SE38' USING BDCDATA MODE 'N'

MESSAGES INTO ITAB.

Regards,

Suresh

Former Member
0 Kudos

HI

GOOD

AS PER YOUR REQUIREMENT YOU R DISPLAYUING SOME FIELDS IN ALV REPORT AND AFTER SELECTING A LINE YOU WANT TO CALL A TRANSACTION ,SO WHAT TRANSACTION YOU WANT TO CALL HERE AND YOU WANT TO DISPLAY THE FIELD VALUE IN THAT TRANSACTION FIELD.

THIS IS QUITE CONFUSING.

WHY YOU NEED TO CALL THE CALL TRANSACTION HERE.BECAUSE YOU R NOT DOING ANYKIND OF RECORDING HERE,YOU HAVE ALREADY DATA IN YOUR ALV LIST.

SO CAN YOU POST AGAIN WHT IS YOUR REQUIREMENT.

THANKS

MRUTYUN

hymavathi_oruganti
Active Contributor
0 Kudos

i think u can do like this.

1. u need to get the contents of the selected line first.

for that, u need to set buttons befor each row, and use get_selected_row method and all.

for that u need to do is use LVC FIELD CAT instead of slis type.

if u want the details how to get the data of selected row, i will send u in detail.

2. store the contents of selected row in an internal table.

3. download the contents into a flat file using gui_dowload

3. now when u click , u need to call a transaction right.

now record that transaction which u need to call and using the flat filw hich we got by downloading, u can upload data into transaction using BDC.