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: 

problem with smartforms

Former Member
0 Kudos

Dear all,

I am working on <b>smartforms</b>. i hv one problem in that. if i use one internal table in smartforms i got exact output wht i want. but if my finalitab contain data of two tables. for eg

<b>tables: MARA, MAKT.</b>

itab1 like mara.

itab2 like makt.

finalitab contains fields from both itabs i.e.

<b>finalitab</b> having fields like matnr, mtart, mbrsh, maktx

how will i define these tables into smartforms so that i will get data from two different tables. i hv tried some options but they are not working.

plz give me sample example with code as early as possible.

thanks in advance.

vinod

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi ,

you can refer following..

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'ZFI_DEB_CRE_NOTE_FORM'

    • formname = 'ZFI_CRDR_PANKAJ'

IMPORTING

fm_name = fm_name.

CALL FUNCTION fm_name

EXPORTING

control_parameters = v_con

user_settings = 'X'

text = p_long

IMPORTING

document_output_info = out_info

job_output_info = prn_ret

job_output_options = out_op

TABLES

gs_out = gs_out

gs_out1 = gs_out_item

git_adrc = git_adrc.

in smartform also you have to define multipal internal tables.

Pankaj

7 REPLIES 7

Former Member
0 Kudos

Hi ,

you can refer following..

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'ZFI_DEB_CRE_NOTE_FORM'

    • formname = 'ZFI_CRDR_PANKAJ'

IMPORTING

fm_name = fm_name.

CALL FUNCTION fm_name

EXPORTING

control_parameters = v_con

user_settings = 'X'

text = p_long

IMPORTING

document_output_info = out_info

job_output_info = prn_ret

job_output_options = out_op

TABLES

gs_out = gs_out

gs_out1 = gs_out_item

git_adrc = git_adrc.

in smartform also you have to define multipal internal tables.

Pankaj

Former Member
0 Kudos

Hi,

If you want to use 2 internal tables, then you have to define those tables in your smartform. Create 2 Tables in abap dictionary, specifying the fields that internal tables contain and use it in ur smartform.

Regards,

Dhana

0 Kudos

thanks for replay,

but actually my problem is that.

i just want finalitab in my smartform.

how can i assign 2 tables to single finalitab.

while assigning second table to finalitab it gives me error.

this is my ABAP program

REPORT ZFORM .

TABLES : ZTAB, kna1.

DATA : BEGIN OF ITAB OCCURS 10,

CODE LIKE ZTAB-CODE,

NAME LIKE ZTAB-NAME,

ADDRESS LIKE ZTAB-ADDRESS,

END OF ITAB.

DATA : BEGIN OF ITAB1 OCCURS 10,

KUNNR LIKE KNA1-KUNNR,

NAME1 LIKE KNA1-NAME1,

*ADDRESS LIKE ZTAB-ADDRESS,

END OF ITAB1.

DATA : BEGIN OF FIITAB OCCURS 10,

CODE LIKE ITAB-CODE,

NAME LIKE ITAB-NAME,

ADDRESS LIKE ITAB-ADDRESS,

KUNNR LIKE ITAB1-KUNNR,

NAME1 LIKE ITAB1-NAME1,

END OF FIITAB.

here i just want to pass this fiitab to my function which is created in smartform.

wht can i do for that.

regds.

vinod

0 Kudos

Hi,

create a table (EX: ZFINAL) with the fields that final itab contain. In smart form,

(1) click on Form Interface -> Tables tab -> Parameter Name -> finalitab,

Type Assistant -> Like,

Associated Type -> ZFINAL

(2) Right click on Main Window (LHS) -> Create -> Table

(3) In Data tab -> Operand -> finalitab; into; finalitab

In your program include the function module,

CONSTANTS: sform TYPE TDSFNAME VALUE '<SMARTFORMNAME>'.

DATA: fname TYPE RS381_FNAM.

TABLES : ZTAB, kna1.

DATA : BEGIN OF ITAB OCCURS 10,

CODE LIKE ZTAB-CODE,

NAME LIKE ZTAB-NAME,

ADDRESS LIKE ZTAB-ADDRESS,

END OF ITAB.

DATA : BEGIN OF ITAB1 OCCURS 10,

KUNNR LIKE KNA1-KUNNR,

NAME1 LIKE KNA1-NAME1,

*ADDRESS LIKE ZTAB-ADDRESS,

END OF ITAB1.

DATA : BEGIN OF FIITAB OCCURS 10,

CODE LIKE ITAB-CODE,

NAME LIKE ITAB-NAME,

ADDRESS LIKE ITAB-ADDRESS,

KUNNR LIKE ITAB1-KUNNR,

NAME1 LIKE ITAB1-NAME1,

END OF FIITAB.

<POPULATE ALL THE REQUIRED FIELDS IN UR FIITAB>

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = sform

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

fm_name = fname

  • EXCEPTIONS

  • NO_FORM = 1

  • NO_FUNCTION_MODULE = 2

  • OTHERS = 3

.

*IF sy-subrc eq 0.

CALL FUNCTION fname

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

itab3 = FIITAB

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5

0 Kudos

hey ur solution is very helpful to me

but i hv still problem while creating table on main window of smartforms.

it show some line type error.

plz help me

thnks for previous solution.

regds,

vinod

Former Member
0 Kudos

Hi,

Here is a sample program in which used two internal tables:

REPORT YPRINTPRG_SMARTFORM1 .

DATA : ITKNA1 LIKE KNA1,

ITVBAK LIKE VBAK OCCURS 0 WITH HEADER LINE.

PARAMETERS : PKUNNR LIKE KNA1-KUNNR.

SELECT * FROM KNA1 INTO ITKNA1

WHERE KUNNR = PKUNNR.

ENDSELECT.

SELECT * FROM VBAK

INTO TABLE ITVBAK

WHERE KUNNR = PKUNNR.

CALL FUNCTION '/1BCDWB/SF00000011' “THIS FUNCTION MODULE CALLS THE

SMART FORM WE WILL GET THIS AT MENU ENVIRONEMENT ”

EXPORTING

ITKNA1 = ITKNA1

TABLES

ITVBAK = ITVBAK.

IN SMART FORM

FORM INERFACE----


IMPORT (TAB)

Parameter name Type assignment Reference type Default value

ITKNA1 LIKE KNA1

FORM INERFACE----


TABLES (TAB)

ITVBAK LIKE VBAK

PAGES & WINDOWS--- MAIN WINDOW-LOOP 1--DATA(TAB)

ITVBAK INTO ITVBAK

PAGES & WINDOWS-----MAIN WINDOW--LOOP 1---TEXT 3(EDITOR)

&ITVBAK-VBELN& &ITVBAK-ERDAT& &ITVBAK-ERNAM& &ITVBAK-NETWR&

PAGES & WINDOWS-----HEADER WINDOW---TEXT 2(EDITOR)

Customer No. &itkna1-kunnr& CustomerName :&itkna1-name1&

Hope it helps.

Reward if helpful.

Regards,

Sipra

0 Kudos

Hi Vinod,

In Global Definations Intilization you define the internal tables and retrive data to the final itab from Mara & other table by using join statement.

In the main window create table in that table we can find data tab there u assing this final itab to one field symbol.

One thing u need to assign Database table in Global definations and Field symbols also.

Thanks,

Rani.