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

ABAP general and Forms

Former Member
0 Likes
1,643

Hi Peers,

I am working on the report which calling the Form from SAP Script and displaying the form.

I wanted a selection screen in which if the user enters some value it should automatically preview in the form.

I am really new to the ABAP Pls some help on this .

Any code is appreciated.

Every answers will be rewarded.

Pls peers help on this.

Seema.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,606

plz clearly specify your requirement

Hi Peers,

I am working on the report which calling the Form from SAP Script and displaying the form.

I wanted a selection screen in which if the user enters some value it should automatically preview in the form.

I am really new to the ABAP Pls some help on this .

Any code is appreciated.

Every answers will be rewarded.

Pls peers help on this.

Seema.

14 REPLIES 14
Read only

Former Member
0 Likes
1,607

plz clearly specify your requirement

Read only

0 Likes
1,606

Hi kannan,

I have to provide a input value on the page and it should also display on the form.

pls any example is appriciate.

Seema.

Read only

0 Likes
1,606

Hi Seema,

data:

w_func(40) type c.

parameters:

p_value(10) type c.

*****************

<b>CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'</b>

EXPORTING

formname = 'ZYH642_TEST_2' " ur form name

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

fm_name = w_func.

<b>call functio w_func</b>

exporting

value = p_value.

**********************

in ur form..

take .... in ur form interface.. value type c.

Read only

0 Likes
1,606

Hi Ram,

Pls help.

Seema.

Read only

0 Likes
1,606

Hi

Do i have to specify any variable in the form also.

Seema.

Read only

0 Likes
1,606

Hi Seema,

Please use the below code.

Print Program:

Report zprg no standard page heading.

selection-screen begin of block b1.

parameters : name(20) type c,

designa(20) type c,

signatu(20) type c.

selection-screen end of block b1.

start-of-selection.

call function 'OPEN_FORM'

exporting

form = 'Z_TESTING1'

language = sy-langu.

call function 'START_FORM'

exporting

form = 'Z_TESTING1'

language = 'E'

startpage = 'PAGE1' .

call function 'WRITE_FORM'

exporting

element = 'MAIN'

type = 'BODY'

window = 'MAIN' .

call function 'END_FORM' .

call function 'CLOSE_FORM'.

SAPScript:

Create a Main Window, a Paragraph as 'A' and Page as 'PAGE1' and use the below code in the text element of the Main Window.

/E MAIN

A &NAME&

A &DESIGNA&

A &SIGNATU&

Hope this helps.

Thanks,

Srinivasa

Read only

0 Likes
1,606

Hi Srini,

I will try this and let you know .

Thankyou very very much.

Seema.

Read only

0 Likes
1,606

Hi

define Parameters , in start-of-selection , put the same in the Script , write that field in Script like &name&, &signatur& etc.....

This is very simple .

Take care.

Manoj Shakya.

Read only

0 Likes
1,606

Hi

Did you tried it?

Manoj Shakya.

Read only

Former Member
0 Likes
1,606

Hi,

Create a Parameters in the Report, so in the start-of-seelction the field value will be available, so the same value will be avialable in the Script also, just write that field in Script like &P_Field&

Regards

Sudheer

Read only

Former Member
0 Likes
1,606

Hi Seema,

You can pass the selection screen variables to the SapScript using the FM write_form through some Text element.

From SAPScript using this Text Element, you can display the selection screen input values.

Hope this helps.

Thanks,

Srinivasa

Read only

0 Likes
1,606

Hi Sudheer / Srinivas,

I know that but actually needed some example so that it will more clearify how to write.

I am new to tis domain and at learning stage.

Pls help.

Seema.

Read only

Former Member
0 Likes
1,606

In the Program..

write it as...

parameters : p_value type i value 234.

use OPEN_FORM & CLOSE_FORM to call a script !!

Check these links..

http://www.thespot4sap.com/Articles/SAPscript_Introduction.asp

http://help.sap.com/saphelp_crm40/helpdata/en/16/c832857cc111d686e0000086568e5f/content.htm

the program looks like this..

REPORT ZPSAPSCRIPT.

TABLES : EKKO,

EKPO,

KNA1,

USR01,

MARA,

MAKT.

DATA : BEGIN OF ZOPTION.

INCLUDE STRUCTURE ITCPO.

DATA : END OF ZOPTION.

PARAMETERS: P_EBELN LIKE EKKO-EBELN,

P_EBELP LIKE EKPO-EBELP.

CLEAR EKPO.

SELECT SINGLE * FROM EKPO

WHERE EBELN = P_EBELN AND

EBELP = P_EBELP.

CLEAR KNA1.

SELECT SINGLE NAME1 FROM KNA1

INTO KNA1-NAME1

WHERE KUNNR = EKPO-KUNNR.

CLEAR MAKT.

SELECT SINGLE MAKTX FROM MAKT

INTO MAKT-MAKTX

WHERE MATNR = EKPO-MATNR AND

SPRAS = SY-LANGU.

CLEAR USR01.

SELECT SINGLE * FROM USR01 WHERE BNAME = SY-UNAME.

ZOPTION-TDDEST = USR01-SPLD. "Output device (printer)

ZOPTION-TDIMMED = 'X'. "Print immediately

ZOPTION-TDDELETE = 'X'. "Delete after printing

ZOPTION-TDPROGRAM = 'ZPQRPRNT'. "Program Name

CALL FUNCTION 'OPEN_FORM'

EXPORTING

APPLICATION = 'TX'

  • ARCHIVE_INDEX = ' '

  • ARCHIVE_PARAMS = ' '

DEVICE = 'PRINTER'

DIALOG = ' '

FORM = 'Z_TESTSCRIPT'

LANGUAGE = SY-LANGU

OPTIONS = ZOPTION

IMPORTING

LANGUAGE = SY-LANGU

EXCEPTIONS

OTHERS = 1.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'HEADER'

  • FUNCTION = 'SET'

  • TYPE = 'BODY'

WINDOW = 'HEADER'

EXCEPTIONS

ELEMENT = 1.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'MAIN'

  • FUNCTION = 'SET'

  • TYPE = 'BODY'

WINDOW = 'MAIN'

EXCEPTIONS

ELEMENT = 1.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'FOOTER'

  • FUNCTION = 'SET'

  • TYPE = 'BODY'

WINDOW = 'FOOTER'

EXCEPTIONS

ELEMENT = 1.

CALL FUNCTION 'CLOSE_FORM'

EXCEPTIONS

UNOPENED = 1

OTHERS = 2.

regards,

sai ramesh

Read only

0 Likes
1,606

Hi All Peers,

The code seems good but i have the field like

name ________ Signature _________

Designation_______

Suppose i am giving in the first page of the report name = abc

then this abc should display in the form also as ABC .

Seema.