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: 

regarding passing an internal table from print program to smartform....

Former Member
0 Kudos
281

Hi All,

can any body let me how to pass an internal table to the smartform, i have processed the data in the print program then i want to pass the final internal table from the print program to smartform and with that data in the internal table i have to process it in the smartform (i want to get some more data based on the internal table data from the print program) and then i will display finally.

for example: i have it_qals which contains all the lot numbers which is processed in teh printprogram, now i want to pass all these (it_qals) lotnumbers to smartform , and in the smartform i will use the lotnumbers in the it_qals table and will process other data accordingly

can any body help me plzz.. its very urgent

1 ACCEPTED SOLUTION

Former Member
0 Kudos
126

Chek this code i am coping my whole program here.

REPORT ZDP_SMARTFORMS_REPORT3 .

TABLES: MARA,

MAKT.

DATA: FNAME TYPE RS38L_FNAM.

DATA: BEGIN OF ITJOIN OCCURS 0.

INCLUDE STRUCTURE ZDP_JOIN__IN_SMARTFORM.

  • INCLUDE STRUCTURE MARA.

  • INCLUDE STRUCTURE MAKT.

data: END OF ITJOIN.

*DATA: BEGIN OF ITJOIN OCCURS 0,

  • MATNR LIKE MARA-MATNR,

  • END OF ITJOIN.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

SELECT-OPTIONS: MAT FOR MARA-MATNR.

SELECTION-SCREEN END OF BLOCK B1.

***----


SELECT MARA~MATNR MAKTX "UP TO 5 ROWS

FROM MARA JOIN MAKT ON MARAMATNR = MAKTMATNR

INTO TABLE ITJOIN

WHERE MARAMATNR IN MAT and maktspras eq 'EN'.

  • into corresponding fields of table it

*SELECT MATNR UP TO 5 ROWS FROM MARA INTO TABLE ITJOIN

  • WHERE MATNR IN MAT.

***----


CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

FORMNAME = 'ZDP_SMARTFORMS_3'

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

FM_NAME = FNAME

  • EXCEPTIONS

  • NO_FORM = 1

  • NO_FUNCTION_MODULE = 2

  • OTHERS = 3

.

IF SY-SUBRC <> 0.

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

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

ENDIF.

    • not necessar y above function if u copy function name from

**- smartforms>environment>function name

CALL FUNCTION '/1BCDWB/SF00000037'

  • EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

  • CONTROL_PARAMETERS =

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

  • OUTPUT_OPTIONS =

  • USER_SETTINGS = 'X'

  • IMPORTING

  • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO =

  • JOB_OUTPUT_OPTIONS =

TABLES

ITJ = ITJOIN

  • EXCEPTIONS

  • FORMATTING_ERROR = 1

  • INTERNAL_ERROR = 2

  • SEND_ERROR = 3

  • USER_CANCELED = 4

  • OTHERS = 5

.

IF SY-SUBRC <> 0.

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

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

ENDIF.

Also check these links

Check out this link,

http://www.erpgenie.com/abap/smartforms.htm

and also refer these threads,

Hope this helps.

ashish

13 REPLIES 13

Former Member
0 Kudos
127

Chek this code i am coping my whole program here.

REPORT ZDP_SMARTFORMS_REPORT3 .

TABLES: MARA,

MAKT.

DATA: FNAME TYPE RS38L_FNAM.

DATA: BEGIN OF ITJOIN OCCURS 0.

INCLUDE STRUCTURE ZDP_JOIN__IN_SMARTFORM.

  • INCLUDE STRUCTURE MARA.

  • INCLUDE STRUCTURE MAKT.

data: END OF ITJOIN.

*DATA: BEGIN OF ITJOIN OCCURS 0,

  • MATNR LIKE MARA-MATNR,

  • END OF ITJOIN.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

SELECT-OPTIONS: MAT FOR MARA-MATNR.

SELECTION-SCREEN END OF BLOCK B1.

***----


SELECT MARA~MATNR MAKTX "UP TO 5 ROWS

FROM MARA JOIN MAKT ON MARAMATNR = MAKTMATNR

INTO TABLE ITJOIN

WHERE MARAMATNR IN MAT and maktspras eq 'EN'.

  • into corresponding fields of table it

*SELECT MATNR UP TO 5 ROWS FROM MARA INTO TABLE ITJOIN

  • WHERE MATNR IN MAT.

***----


CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

FORMNAME = 'ZDP_SMARTFORMS_3'

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

FM_NAME = FNAME

  • EXCEPTIONS

  • NO_FORM = 1

  • NO_FUNCTION_MODULE = 2

  • OTHERS = 3

.

IF SY-SUBRC <> 0.

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

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

ENDIF.

    • not necessar y above function if u copy function name from

**- smartforms>environment>function name

CALL FUNCTION '/1BCDWB/SF00000037'

  • EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

  • CONTROL_PARAMETERS =

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

  • OUTPUT_OPTIONS =

  • USER_SETTINGS = 'X'

  • IMPORTING

  • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO =

  • JOB_OUTPUT_OPTIONS =

TABLES

ITJ = ITJOIN

  • EXCEPTIONS

  • FORMATTING_ERROR = 1

  • INTERNAL_ERROR = 2

  • SEND_ERROR = 3

  • USER_CANCELED = 4

  • OTHERS = 5

.

IF SY-SUBRC <> 0.

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

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

ENDIF.

Also check these links

Check out this link,

http://www.erpgenie.com/abap/smartforms.htm

and also refer these threads,

Hope this helps.

ashish

Former Member
0 Kudos
126

Hi ram,

Create a Structure as per ur internal table and in smartform in form interface under table tabstrip declare a table using type table of the structure.

eg itab type table of struct.

regards,

Santosh

0 Kudos
126

but i dont want to create a structure. i want to pass this internal table to smartform and based on this data i want to fetch some more data from other tables, in the smartform

0 Kudos
126

In smartforms:

In form interface:

In import : declare itab as type table of structure name.

Ex:

Parametr name: i_ekko.

Type Assignment: Type table of

Reference type: ekko

Former Member
0 Kudos
126

Hi,

Inorder to pass an internal table first you have declare the particular internal table ie it_qals in the tables part of the Form interface of the required Smartform.And then while calling the smartform do specify it_qals in the tables part of the call function.

Hope this helps u.

Do revert for any clarifications.

Reward points if helpful.

Thanks and regards,

Litta

0 Kudos
126

can you explian me some more clearly....

Former Member
0 Kudos
126

Hi,

In the smartform, first choose the form interface....

Then select the Tables tab and declare your internal table it_qals.

After completing this while calling your smartform specify it_qals under the tables part so that the entire internal table content is passed into the form...

Thanks and Regards,

Litta.

0 Kudos
126

so, can i use the table that i have passed to the smartform. so that based on the data i wil fetch some more data from other tables also

Former Member
0 Kudos
126

Hi,

Sure...You will get the entire table content it_qals in your smartform so that you can either process the same or you can display it...

Hope this satisfies your requirement...

Reward points if useful.

Thanks and regards,

Litta.

0 Kudos
126

i have declered it like this in the form interface of the smartform

it_qals1 type table of qals

and in the

report i have it_qals declared like this

types: begin of t_qals1,

include type qals,

end of t_qals1.

DATA : it_qals1 TYPE STANDARD TABLE OF t_qals1,

wa_qals1 LIKE LINE OF it_qals1.

and in this i have 10 records (inspection lot numbers)

and based on these inspection lot number i have to get some more data from other tables.

is this the correct declaration or anything else to be included.

Former Member
0 Kudos
126

Hi,

Declare as below in the Tables of form interface.

Paramenter name: it_qals

Type assignment: LIKE

Associated type: QALS

And in the program just declare as shown below

DATA: it_qals TYPE TABLE OF QALS.

Thanks and Regards,

Litta

0 Kudos
126

i want to use the data in the it_qals in the smartform

for example i want it like this

loop at it_qals in to wa_qals

select single prueflos

art

losmenge

charg

matnr

lifnr

mblnr

from qals

into (wa_finl-prueflos, wa_finl-art, wa_finl-ebeln, wa_finl-matnr,

wa_finl-losmenge, wa_finl-lifnr, wa_finl-charg, wa_finl-mblnr)

WHERE prueflos = wa_qals-prueflos.

SELECT SINGLE xabln

usnam

xblnr

FROM mkpf

INTO (wa_mkpf-xabln, wa_mkpf-usnam, wa_mkpf-xblnr)

WHERE mblnr = wa_finl-mblnr.

SELECT SINGLE name1

INTO wa_name1

FROM lfa1

WHERE lifnr = wa_finl-lifnr.

SELECT SINGLE ebeln

INTO wa_ernam

FROM ekko

WHERE ebeln = wa_finl-ebeln.

SELECT SINGLE maktx

INTO wa_maktx

FROM makt

WHERE matnr = wa_finl-matnr.

append wa_finl to it_finl.

append wa_mkpf to it_mkpf.

end loop.

so this is the thing i have to do in smartform based on the internal table data from Print program..

please help me to find a solution and remove the confusion in my mind...

Former Member
0 Kudos
126

Hi,

As I have mentioned earlier,after declaring it_qals under the table tab of form interface,it_qals will be treated as an internal table in the smartform (as in a program) and u can process the same with the above listed code in the smartform...

Just declare the same as I have said earlier and check.

Thanks and Regards,

Litta.