cancel
Showing results for 
Search instead for 
Did you mean: 

getting data from driver program

Former Member
0 Kudos

Dear all,

can any tell me how to get data of internal table of the print program in smartform. my internal table of print program have combine data from diffrent table.

please give me one example for it if possible.

Rajesh

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

I got correct Answer and gave points and sorry for late to give points.

Former Member
0 Kudos

Hi Rajesh,

Have u made the final internal table, from where u want to display the data.

If yes, then go to SE11, select types, create a structure the same as your internal table. After that create a Table type referring to the earlier structure, it can be created in the same way (SE11-> Types-> Table Types)

In your Smartform, go to Form Interface, select TABLE header tab, declare a table of the type TABLE TYPE u created.

eg :

itab type tabletype ( u created)

once u have created the table, call the function mudule (that is generated after activating the smartform (Environment -> Function Module)) in the Print Program, and in that mention the name of the internal table u gonna use.

Hope this Info will help u out

Regards with Points if helpful

Karan

Former Member
0 Kudos

1. Create a smartform .

2. Create a Global Structure using Transaction SE11 (Using Datatype, create components (fields) required for printing the smartform).

3. Create a driver program using Transaction SE38.

<&----


*& Report ZSTICKET_SF_AJAP

*&

&----


*& Driver Program

*&

&----


REPORT zsticket_sf_ajap.

TABLES:

sflight,

sbook,

scustom.

TYPES: BEGIN OF st_ticket.

INCLUDE STRUCTURE zst_ticket. " Global Structure

TYPES : END OF st_ticket.

DATA it_ticket TYPE TABLE OF st_ticket.

DATA fname TYPE rs38l_fnam.

SELECT a~name

b~customid

b~carrid

c~connid

c~fldate

c~price

c~currency

INTO CORRESPONDING FIELDS OF TABLE it_ticket

FROM scustom AS a

INNER JOIN sbook AS b

ON aid = bcustomid

INNER JOIN sflight AS c

ON bcarrid = ccarrid

WHERE b~carrid = 'AA'

AND a~id = '3193'.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'ZTICKET_AJAP'

IMPORTING

fm_name = fname.

IF sy-subrc <> 0.

ENDIF.

*The function module generated during the execution of smartform is given.

CALL FUNCTION '/1BCDWB/SF00001143'

TABLES

it_ticket = it_ticket.

IF sy-subrc <> 0.

ENDIF.>

*----


4. In the smartform ,

In the Form Interface- Tables tab declare the internal table.

For Eg: IT_TICKET LIKE ZST_TICKET

Former Member
0 Kudos

Hi,

In SE11 create a structure or table type that has the same layout as your print program's internal table.

Define this table (using the type just created) in the interface of the smartform.

When you call the smartform function module, pass the internal table from the print program.

Regards,

Nick

Former Member
0 Kudos

Dear Shiva Kumar,

I want to get data from print program which have combine data of diffrent table. i want to use this data in smartform using tables tabe of Form Interface, because i want to display these data in smartform.

Plese help me.

Rajesh

Former Member
0 Kudos