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

urgent smartforms!!!!!!

Former Member
0 Likes
2,338

hi,

i hav a table called zborrower which contains 5 fields , one of the field is :"date_of_return" ....i need to display the details of the borrower based on the date range for date_of_return in the smartform using select options.......how could i do this??.......if there is any other method other than the select options do let me knw.......thank you

1 ACCEPTED SOLUTION
Read only

former_member189629
Active Contributor
0 Likes
2,319

Reshma,

- Use SELECT-OPTIONS or RANGES for date range

- Do a select to ur Z table & populate your itab

- Send it to the Smartform & display (I hope u know how to do it: send it in the tables option of your smartform FM)

- Loop thru the itab in ur smartform

- Display data

Reward points for useful Answers

Regards

Karthik

23 REPLIES 23
Read only

Former Member
0 Likes
2,319

Hi Reshma,

As per my understanding you wud be triggering the smartform fro a driver program. In that case Select options is the most efficient way to select data into an internal table which you can pass to the SF interface.

Let me know if you need any more info else pl reward points.

Regards.

Read only

Former Member
0 Likes
2,319

write a driver program and specify ur select options and call ur smart fom in that driver program.I think this would be helpful.

Read only

former_member189629
Active Contributor
0 Likes
2,320

Reshma,

- Use SELECT-OPTIONS or RANGES for date range

- Do a select to ur Z table & populate your itab

- Send it to the Smartform & display (I hope u know how to do it: send it in the tables option of your smartform FM)

- Loop thru the itab in ur smartform

- Display data

Reward points for useful Answers

Regards

Karthik

Read only

0 Likes
2,319

i actually hav a report that asks for the date range and displays the reocord based on this date range ...this report conatins a push button "smartform" ...which shud display the same records as that of the report in the smartform

Read only

0 Likes
2,319

Do u wanna know how u generate a smartform once that button is clicked?

Read only

0 Likes
2,319

i want to knw how to display the record that is displayed wen i execute the report in the smartform.

Read only

0 Likes
2,319

hi reshma

pls as follow

TABLES: MKPF.

DATA: FM_NAME TYPE RS38L_FNAM.

DATA: BEGIN OF INT_MKPF OCCURS 0.

INCLUDE STRUCTURE MKPF.

DATA: END OF INT_MKPF.

SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.

  • At the end of your program.

  • Passing data to SMARTFORMS

START-OF-SELECTION.

PERFORM GET_DATA.

END-OF-SELECTION.

PERFORM TEST_SMARTFORMS USING 'ZSAMP_SSMART' .

&----


*& Form GET_DATA

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form GET_DATA .

CLEAR : INT_MKPF , INT_MKPF[] .

SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.

MOVE-CORRESPONDING MKPF TO INT_MKPF.

APPEND INT_MKPF.

ENDSELECT.

endform. " GET_DATA

&----


*& Form TEST_SMARTFORMS

&----


  • text

----


  • -->P_0036 text

----


form TEST_SMARTFORMS using value(p_0036).

CLEAR FM_NAME .

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

FORMNAME = 'ZSAMP_SSMART'

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

TABLES

INT_MKPF = INT_MKPF

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.

endform. " TEST_SMARTFORMS

Read only

0 Likes
2,319

I assume the report output is from a single itab and the there is code already to generate the smartform.

Now pass this itab in the tables section of the Smartform Function Module,

Declare a workarea in the Smartform

Loop the itab into the WA & Display data.

That's it. Lemme know if u need more info...

Read only

0 Likes
2,319

do i hav to declare that itab in the form interface of the smartform........this itab is of type structure ........how could i do this??

Read only

0 Likes
2,319

yes, u will have to declare int he form interface. Wat did u mean by TYPE Structure? that's how it will be... Also declare a WA with the same type. In the main window, loop the itab into the work area. Create a report-like template and display your WA fields...

Read only

0 Likes
2,319

do as follow

use ur report to fill the itab

and then call the smartform by passing that itab to smartform under TABLES

then create a structure in ddic and give the same fields as it is in ur itab.

now open ur smartform

in the interface->tables->

write itab like structure name u made

then u can use this itab.

the point is

if u r passing an itab to ur smartform

u hav to create a structure in ddic

and then declare an itab with type structure same as structure in ddic

tell me if u want more

reward if useful

Read only

0 Likes
2,319

Hi,

First get the data based on ur select-option in the driver program and put it into internal table ( itab1 type zborrower).

after fetching the data into itab1, then in the FORM INTERFACE of SMartform ,

Under TABLES tab, decalre as ITAB like ZBORROWER.

Now inthe Driver Program " call FM SSF_Function_module_name"

after the Call FM 'FMOD" <----Gnerated by smartform.

In this pass ur itab1 (of driver prog) to ITAB (of smartyform).

Rvert back if any issues,

Reward if helpful.

Regards,

Naveen

Read only

0 Likes
2,319

TYPES : BEGIN OF struct,

bookid TYPE zbooks-bookid,

bname TYPE zbooks-bname,

bmodule TYPE zbooks-bmodule,

copies TYPE zbooks-copies,

bavailable TYPE zbooks-bavailable,

borrowername TYPE zborrower-borrowername,

dateofborrower TYPE zborrower-dateofborrower,

dateofreturn TYPE zborrower-dateofreturn,

END OF struct.

DATA : itab TYPE TABLE OF struct.

DATA : wa LIKE LINE OF itab.

this is the structure...

Read only

0 Likes
2,319

pls send ur code first.after then all r help u

Read only

0 Likes
2,319

did u try my idea??crating structure in ddic and then using it in smartform

Read only

0 Likes
2,319

&----


*& Report ZREP

*&

&----


*&

*&

&----


REPORT zrep NO STANDARD PAGE HEADING LINE-SIZE 200.

TABLES : zbooks,zborrower.

TYPES : BEGIN OF struct,

bookid TYPE zbooks-bookid,

bname TYPE zbooks-bname,

bmodule TYPE zbooks-bmodule,

copies TYPE zbooks-copies,

bavailable TYPE zbooks-bavailable,

borrowername TYPE zborrower-borrowername,

dateofborrower TYPE zborrower-dateofborrower,

dateofreturn TYPE zborrower-dateofreturn,

END OF struct.

DATA : itab TYPE TABLE OF struct.

DATA : wa LIKE LINE OF itab.

SELECT-OPTIONS : s_dob FOR zborrower-dateofborrower.

PARAMETERS : p_bname TYPE zbooks-bname.

START-OF-SELECTION.

SET PF-STATUS 'SMARTFORMS'.

SELECT *

INTO CORRESPONDING FIELDS OF TABLE itab

FROM zbooks AS a

INNER JOIN zborrower AS b ON abookid = bbookid

WHERE b~dateofborrower IN s_dob

AND a~bname = p_bname.

LOOP AT itab INTO wa.

WRITE : /10 sy-vline,

15 wa-bookid COLOR 1 INTENSIFIED ON,25 sy-vline,

26 wa-bname COLOR 2 INTENSIFIED OFF,51 sy-vline,

52 wa-borrowername COLOR 4 INTENSIFIED OFF ,77 sy-vline,

78 wa-dateofborrower COLOR 7 INTENSIFIED OFF,95 sy-vline,

96 wa-dateofreturn COLOR 1 INTENSIFIED OFF ,120 sy-vline.

ENDLOOP.

WRITE:/10 sy-uline(111).

AT USER-COMMAND.

CASE sy-ucomm.

WHEN 'SMARTFORM'.

CALL FUNCTION '/1BCDWB/SF00000231'

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

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

ENDCASE.

TOP-OF-PAGE.

WRITE: /10 sy-uline(111),

/10 sy-vline ,15 'BOOK ID' COLOR 1 INTENSIFIED OFF,

25 sy-vline, 26 'BOOK NAME' COLOR 2 INTENSIFIED OFF,

51 sy-vline, 52 'BORROWER NAME' COLOR 4 INTENSIFIED OFF,

77 sy-vline, 78 'DATE OF BORROWER' COLOR 7 INTENSIFIED OFF,

95 sy-vline, 96 'DATE OF RETURN' COLOR 1 INTENSIFIED OFF,

120 sy-vline.

WRITE:/10 sy-uline(111).

END-OF-PAGE.

END-OF-SELECTION.

WRITE:/'Current Date:' COLOR 3 INTENSIFIED OFF,sy-datum.

Read only

0 Likes
2,319

CALL FUNCTION '/1BCDWB/SF00000231'

  • EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

  • CONTROL_PARAMETERS =

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

  • OUTPUT_OPTIONS =

  • USER_SETTINGS = 'X'

<b>TABLES

ITAB = ITAB</b>

  • IMPORTING

  • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO =

  • JOB_OUTPUT_OPTIONS =

  • EXCEPTIONS

  • FORMATTING_ERROR = 1

  • INTERNAL_ERROR = 2

  • SEND_ERROR = 3

  • USER_CANCELED = 4

  • OTHERS = 5

create same structrue like itab in ddic and then

declare an itab wid that strucute

Read only

0 Likes
2,319

hi reshma

first u create 1 smartform goto smartform

and after then u call

AT USER-COMMAND.

CASE sy-ucomm.

WHEN 'SMARTFORM'.

CLEAR FM_NAME .

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

FORMNAME = 'ZSAMP_SSMART'

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

TABLES

INT_MKPF = INT_MKPF

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.

so procees like this .

use the this functiom nodule

it will get display in smartform.

ok

regards

kk.

Read only

0 Likes
2,319

is ur problem solved

Read only

0 Likes
2,319

i hav created a structure in ddic as zbook_struct ....i am getting an error telling "the field wa cannot be changed" in the smartform..i hav declared the wa and itab in smartform as..

itab type table of zbook_struct

wa type zbook_struct

Read only

0 Likes
2,319

hey

in the smartform interface

go to in the table tab

now here write

itab like z_booking

now u can use this itab

tell if the prob is not solved

and call the fucntion to call smartform

as in my post above

Read only

Former Member
0 Likes
2,319

i actually hav a report that asks for the date range and displays the reocord based on this date range ...this report conatins a push button "smartform" ...which shud display the same records as that of the report in the smartform

Read only

Former Member
0 Likes
2,319

you need t create a structure similar to that of the structure of the internal table in your driver program.then to table interface in the smart form declare like this.

itba like ztruc.(zstruc should the name of the structure u created in dictionary.)

in program lines go for the looping condition stating that itab into work area or header .

then drag and drop the required field from table interface into the respective windows.In this way you will get the values into the layout.Once you are done let me know to what extent this has helped you and give me the marks.