cancel
Showing results for 
Search instead for 
Did you mean: 

Interview questions on Scripts & Smartforms

Former Member
0 Kudos

Can anyone please help me with the answers for these questions that were asked in an interview.

1. in Scripts, I have 10 address lines there were blanks in between rows how can I avoid those?

2. In smartforms, If I want to transfer the data from print programme to smartform, How can I do?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Scripts: Create a Paragraph format for the Address lines and define NO BLANK LINES for that paragraph and then use that while printing address, it will skip all blank lines

Smartforms:

When you execute the fun module call function 'SSF_FUNCTION_MODULE_NAME' and call function FM_NAME

the data structures/int tables were transfered from driver program to Smartform.

We use those data fields in smartforms to display data

<b>Reward points for useful Answers</b>

Regards

Anji

Former Member
0 Kudos

Hello Anji,

Thanks for your reply I just need some more clarifications from you over the same. Could you tell me as to how we can define NO BLANK LINES for a paragraph? Is there any command available like SET BLANK LINES OFF as in reports? Please do let me know as to how we can doe the same in Scripts. And when we call SSF_FUNCTION_MODULE_NAME we dont pass any tables or fields with the same. So is it not possible to pass any value from the print program to the SMARTFORM? Am sorry its just that am a beginner trying to make it into SAP. Hope that you would extend your patience a bit in replying back to me. Thanks

Former Member
0 Kudos

Hi

When you create a paragraph format in SE71

you will observe one check box for NO BLANK LINES

just check that, it is a property of that Paragraph format..

If you see the following code of smartform you will observe the internal tables that are passed to it and they are used in smartform

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.

SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.

MOVE-CORRESPONDING MKPF TO INT_MKPF.

APPEND INT_MKPF.

ENDSELECT.

  • At the end of your program.

  • Passing data to SMARTFORMS

call function 'SSF_FUNCTION_MODULE_NAME'

exporting

formname = 'ZSMARTFORM'

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

FM_NAME = FM_NAME

EXCEPTIONS

NO_FORM = 1

NO_FUNCTION_MODULE = 2

OTHERS = 3.

if sy-subrc <> 0.

WRITE: / 'ERROR 1'.

  • 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

<b>GS_MKPF = INT_MKPF</b>

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.

Here in this case we are passing GS_MKPF = INT_MKPF, so this strcuture data can be used in Smartform to display the data

Reward points for useful Answers

Regards

Anji

Former Member
0 Kudos

Thank you very much for your answers. They were very elaborate and useful.

Answers (0)