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

doubt on internal table.

Former Member
0 Likes
600

Hello All,

I have internal table with multiple rows.

Each row has some text. I want to print in smart form as it is in internal table.

Acutally it is questionare in the service order

Please let me knwo if you have the solution

thanks for your time adn cooperation.

Bobby

5 REPLIES 5
Read only

Former Member
0 Likes
581

Hi Bobby,

Pass that internal table in smartform and display it using LOOP node in main window.

hope this may be useful.

please reward.

Ragards,

Prashant

Read only

Former Member
0 Likes
581

Hi,

You need to create a Table in Smartform. Right click on MAIN WINDOW & Click Create=>Table

Enter the internal table name & work area in the from to details

then in the text area , type

&WA_DATA-Field1&,,&WA_DATA-field2&.

Best regards,

Prashant

Read only

Former Member
0 Likes
581

Hi Bobby,

if u want to pass the data from internal table in print program to Smartform.. there is only way.. that is using form interface..

1. goto se11, create a structure same as the itab in the print program.ex. z_itab

2. create line type... se11>select radio button-DATA type>z_it_itab >press create>then select>TABLE Type> then entrer some text--> in the line type Field in giveth Str name u have created in STEP 1. activate it.

3. got SMARTFORMS-> form inteface>tables tabe--> give some name ex IT_tab type z_it_itab.

then acivate it.. then in the driver progam pass this table data.

Exapmpel

CALL FUNCTION fp_v_fm_name

EXPORTING

archive_index = toa_dara

archive_parameters = arc_params

control_parameters = fp_st_control_parameters

user_settings = space

output_options = fp_st_output_options

wa_vbdkr = fp_st_vbdkr

IMPORTING

job_output_info = l_it_ssfcrescl

job_output_options = l_it_ssfcresop

TABLES

IT_tab = z_it_itab (or table in driver program)

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.

Another way is cteate a type in Globaldifination-->types tab..

ex:

types: begin of ty_itab,

matnr type matnr,

meins type meins

vrkme type vrkme,

end of ty_itab,

ty_it_itab type standard table of ty_itab.

then GLOBAL DIFINATION>GLOBAL DATA TAB>IT)ITAB TYPE TY_IT_ITAB.

BUT In this u can't pass the data from the print Program.. if u want to populate data in to this table... u have to write the Select query in the GLOBAL DIFINATIONS-->INITILIZATIONS TAB.

Thanks,

Reward If Helpful.

Read only

former_member196280
Active Contributor
0 Likes
581

if you want to print your internal table in your smartform, create a loop in your smart form and pass your internal table name and display the values.

Close the thread once your question is answered.

Regards,

SaiRam

Read only

former_member189629
Active Contributor
0 Likes
581

Bobby,

Once your itab is populated, pass it to the Smartform. Declare an itab with similar structure in the Form ionterface part. Also declare a structure like yor itab. Now loop the itab into the structure at the desired location ni the SF to output data...

Use the below code for ref

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

FORMNAME = C_FORMNAME

IMPORTING

FM_NAME = G_FM_NAME.

IF SY-SUBRC <> 0.

*--- Check for Errors

ENDIF.

*--- Call Smartform function module without hard coding

CALL FUNCTION G_FM_NAME

EXPORTING

CONTROL_PARAMETERS = ST_CONTROL_PARAMETERS

OUTPUT_OPTIONS = ST_OUTPUT_OPTIONS

  • USER_SETTINGS = 'X'

<b>* ADD YOUR DATA STRUCTURES HERE</b>

TABLES

<b>* ADD YOUR DATA TABLES</b>

<b>it_output = itab_output.</b>

EXCEPTIONS

FORMATTING_ERROR = 1

INTERNAL_ERROR = 2

SEND_ERROR = 3

USER_CANCELED = 4

OTHERS = 5

reward if helpful,

Regards,

Karthik