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: 

Smartfroms?

Former Member
0 Kudos

Hello all,

can anyone forward the steps for creating a 'smartform' with snapshots.

plz it's very urgent.

Thanx in advance......

1 ACCEPTED SOLUTION

Former Member
0 Kudos

SMARTFORMS GENERATION: (calling internal table fields)

 Open a smartform using the tcode ‘smartforms’.

 Usually form attributes shows admn data.

 In the form interface declare import/export parameters if any. Else declare the tables in tables tab button.

 In the windows and pages expand and create a table. It automatically generates header, main area and footer for the table.

 In data tab button in the table we usually declare a work area to bring the data from se38. Like: ktab into wa. ( The purpose of declaring the wa is , to get the data of the ktab in to header from the body area of the internal table).

 And in the tablepainter pushbutton in table we can have any no of line types. Depending on the requirement. ( for ex: If we want to devide a row in to 4 columns, we can devide it as 4,4,4,4cm as line type 1, And usually for the footer we don’t need no of columns, So, we declare it as one column with 16cm measure with the name line type 2.). We can use these line types in the tables.

 In the header right click>>create>>tableline. It asks for line type. Select one line type which is appropriate.

 Like same create a row2 in main area using right click. If we select the line type 1, it automatically generates 4 cells. We can create text in each cell as per requirement.

 We can generate general attributes using general attributes tab button in the text. Or in the other way. We can switch on the field list on/off button from the application tool bar. It displays all the attributes in the left down corner of the screen. We can drag and drop the required fields in the general attributes tab button of the text.

 We continue the same procedure for all the texts. The texts should be displayed in the gray color. Then only it can collects the data from the abap editor fields.

 If it wont turns gray, we can check the fields in the editor by changing it to the line editor. The best thing is to drag the fields from the list, rather than declaring like &wa-matnr&

 In the footer also we create a line type and in that table line we create text.

SE38 PROGRAM(method I):

REPORT Z_CALLING_SMARTFORM2 .

tables: mara.

select-options: S_MATNR for MARA-MATNR.

DATA: kTAB LIKE MARA OCCURS 1 WITH HEADER LINE.

data: FM_NAME TYPE RS38L_FNAM.

SELECT * FROM MARA INTO TABLE kTAB WHERE MATNR in

S_MATNR.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'Z_MYFIRST_FORM2'

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

FM_NAME = FM_NAME

  • 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.

CALL FUNCTION fm_name

  • 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

ktab = ktab

  • 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.

Cheers.

2 REPLIES 2

Former Member
0 Kudos

SMARTFORMS GENERATION: (calling internal table fields)

&#61656; Open a smartform using the tcode ‘smartforms’.

&#61656; Usually form attributes shows admn data.

&#61656; In the form interface declare import/export parameters if any. Else declare the tables in tables tab button.

&#61656; In the windows and pages expand and create a table. It automatically generates header, main area and footer for the table.

&#61656; In data tab button in the table we usually declare a work area to bring the data from se38. Like: ktab into wa. ( The purpose of declaring the wa is , to get the data of the ktab in to header from the body area of the internal table).

&#61656; And in the tablepainter pushbutton in table we can have any no of line types. Depending on the requirement. ( for ex: If we want to devide a row in to 4 columns, we can devide it as 4,4,4,4cm as line type 1, And usually for the footer we don’t need no of columns, So, we declare it as one column with 16cm measure with the name line type 2.). We can use these line types in the tables.

&#61656; In the header right click>>create>>tableline. It asks for line type. Select one line type which is appropriate.

&#61656; Like same create a row2 in main area using right click. If we select the line type 1, it automatically generates 4 cells. We can create text in each cell as per requirement.

&#61656; We can generate general attributes using general attributes tab button in the text. Or in the other way. We can switch on the field list on/off button from the application tool bar. It displays all the attributes in the left down corner of the screen. We can drag and drop the required fields in the general attributes tab button of the text.

&#61656; We continue the same procedure for all the texts. The texts should be displayed in the gray color. Then only it can collects the data from the abap editor fields.

&#61656; If it wont turns gray, we can check the fields in the editor by changing it to the line editor. The best thing is to drag the fields from the list, rather than declaring like &wa-matnr&

&#61656; In the footer also we create a line type and in that table line we create text.

SE38 PROGRAM(method I):

REPORT Z_CALLING_SMARTFORM2 .

tables: mara.

select-options: S_MATNR for MARA-MATNR.

DATA: kTAB LIKE MARA OCCURS 1 WITH HEADER LINE.

data: FM_NAME TYPE RS38L_FNAM.

SELECT * FROM MARA INTO TABLE kTAB WHERE MATNR in

S_MATNR.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'Z_MYFIRST_FORM2'

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

FM_NAME = FM_NAME

  • 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.

CALL FUNCTION fm_name

  • 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

ktab = ktab

  • 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.

Cheers.