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: 

Adobe form as a webdynpto component

Former Member
0 Kudos

Hi all,

I am working on cprojects.

The requirement is to add a new tab in the cproject screen, which has been done.

when we press the new tab, one layout should be displayed in Pdf format, where some fields should be editable to enter values by the user. All the data entered by the user should be stored in a ztable.

For which, I've created a layout using Adobe form, which has to be attached in that tab page. How to attach the form interface as webdynpro component in cproject.

Its Urgent,

Expecting Reply....

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Ultimetly it depends on user requirement. I think you do what they want.

See my code.

  • this handler is called once the page is first created (stateful mode)

  • it performs a once-off data initialization or object creation

DATA: absolute_uri TYPE sapb-uri,

buffer TYPE xstring,

data TYPE ztbl1024,

guid TYPE guid_32,

input TYPE http_api,

it_data TYPE zssfbin,

i_connections TYPE zconnection,

l_pdf_len TYPE i,

pers_no TYPE toav0-object_id,

tabix TYPE sy-tabix,

wa_connection TYPE toav0,

cached_response TYPE REF TO if_http_response,

length TYPE i.

DATA: utility TYPE REF TO cl_http_utility.

data : suname type sy-uname.

suname = UserName.

if suname is initial.

suname = SY-UNAME.

endif.

CALL FUNCTION 'HR_GETEMPLOYEEDATA_FROMUSER'

EXPORTING

username = suname

  • username =

IMPORTING

employeenumber = personnel_no

EXCEPTIONS

user_not_found = 1

countrygrouping_not_found = 2

infty_not_found = 3

OTHERS = 4.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

CONCATENATE personnel_no '0402%' INTO pers_no.

CALL FUNCTION 'ARCHIV_GET_CONNECTIONS'

EXPORTING

objecttype = 'PREL'

object_id = pers_no

client = sy-mandt

archiv_id = 'MA'

  • arc_doc_id = arcdoid

documenttype = 'HROBWFORM'

  • from_ar_date = fdate

  • until_ar_date = udate

  • documentclass = docclass

  • del_date = deldate

  • limited = limited

  • limit = limit

  • importing

  • reducedbylimit = reduced

TABLES

connections = i_connections

  • parameter = parameter

EXCEPTIONS

nothing_found = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

EXIT.

ENDIF.

SORT i_connections BY ar_date DESCENDING.

LOOP AT i_connections INTO wa_connection.

input-command = 'get'.

input-archive = 'MA'.

input-docid = wa_connection-arc_doc_id.

input-accessmode = 'r'.

input -doctype = 'HROBWFORM'.

input-compid = 'data'.

CLEAR: tabix.

tabix = sy-tabix.

CALL FUNCTION 'SCMS_AO_TABLE_GET'

EXPORTING

arc_id = 'MA'

doc_id = wa_connection-arc_doc_id

comp_id = 'data'

IMPORTING

length = length

TABLES

data = data

  • EXCEPTIONS

  • ERROR_HTTP = 1

  • ERROR_ARCHIV = 2

  • ERROR_KERNEL = 3

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

CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'

EXPORTING

input_length = length

  • FIRST_LINE = 0

  • LAST_LINE = 0

IMPORTING

buffer = buffer

TABLES

binary_tab = data

  • EXCEPTIONS

  • FAILED = 1

  • OTHERS = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

*

CREATE OBJECT cached_response TYPE cl_http_response

EXPORTING add_c_msg = 1.

l_pdf_len = XSTRLEN( buffer ).

*

cached_response->set_data( data = buffer

length = l_pdf_len ).

cached_response->set_header_field(

name = if_http_header_fields=>content_type

value = 'application/pdf' ).

cached_response->set_status( code = 200 reason = 'OK' ).

cached_response->server_cache_expire_rel( expires_rel = 180 ).

CALL FUNCTION 'GUID_CREATE'

IMPORTING

ev_guid_32 = guid.

CASE tabix.

WHEN 1.

CONCATENATE runtime->application_url '/' guid '.pdf' INTO display_url1.

cl_http_server=>server_cache_upload( url = display_url1

response = cached_response ).

WHEN 2.

CONCATENATE runtime->application_url '/' guid '.pdf' INTO display_url2.

cl_http_server=>server_cache_upload( url = display_url2

response = cached_response ).

WHEN 3.

CONCATENATE runtime->application_url '/' guid '.pdf' INTO display_url3.

cl_http_server=>server_cache_upload( url = display_url3

response = cached_response ).

ENDCASE.

ENDLOOP.

Reward if useful!

7 REPLIES 7

Former Member
0 Kudos

Hi,

Is it like that,

One page having tabs on EP, one tab contains some editable fields and PDF will be displayed?

0 Kudos

Yes prasad,

Actually i thought of doing in Webdynpro-ALV, but again to generate a report they need a layout. so, i've decided to go for Adobe form staight away.

Reply the suggestion.

Former Member
0 Kudos

Hi Ravi,

In this case, this may help you.

/people/thomas.jung/blog/2006/06/20/web-dynpro-abap-demonstration-videos

I have created in BSP. If you want i can paste code here.

Reward if useful!

0 Kudos

Ok prasad,

Just paste the code.

One more, based on my requirement, is it necessary to go for the webdynpro-alv development or shall i proceed in the sameway what i mentioned in the Qn.

0 Kudos

Hi prasad,

Also i want to know how to retrieve the data from the database table.

For example, I am creating a project in Cprojects, i've to capture all the values into a variable to display in my customised tab page.

Former Member
0 Kudos

Hi,

Ultimetly it depends on user requirement. I think you do what they want.

See my code.

  • this handler is called once the page is first created (stateful mode)

  • it performs a once-off data initialization or object creation

DATA: absolute_uri TYPE sapb-uri,

buffer TYPE xstring,

data TYPE ztbl1024,

guid TYPE guid_32,

input TYPE http_api,

it_data TYPE zssfbin,

i_connections TYPE zconnection,

l_pdf_len TYPE i,

pers_no TYPE toav0-object_id,

tabix TYPE sy-tabix,

wa_connection TYPE toav0,

cached_response TYPE REF TO if_http_response,

length TYPE i.

DATA: utility TYPE REF TO cl_http_utility.

data : suname type sy-uname.

suname = UserName.

if suname is initial.

suname = SY-UNAME.

endif.

CALL FUNCTION 'HR_GETEMPLOYEEDATA_FROMUSER'

EXPORTING

username = suname

  • username =

IMPORTING

employeenumber = personnel_no

EXCEPTIONS

user_not_found = 1

countrygrouping_not_found = 2

infty_not_found = 3

OTHERS = 4.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

CONCATENATE personnel_no '0402%' INTO pers_no.

CALL FUNCTION 'ARCHIV_GET_CONNECTIONS'

EXPORTING

objecttype = 'PREL'

object_id = pers_no

client = sy-mandt

archiv_id = 'MA'

  • arc_doc_id = arcdoid

documenttype = 'HROBWFORM'

  • from_ar_date = fdate

  • until_ar_date = udate

  • documentclass = docclass

  • del_date = deldate

  • limited = limited

  • limit = limit

  • importing

  • reducedbylimit = reduced

TABLES

connections = i_connections

  • parameter = parameter

EXCEPTIONS

nothing_found = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

EXIT.

ENDIF.

SORT i_connections BY ar_date DESCENDING.

LOOP AT i_connections INTO wa_connection.

input-command = 'get'.

input-archive = 'MA'.

input-docid = wa_connection-arc_doc_id.

input-accessmode = 'r'.

input -doctype = 'HROBWFORM'.

input-compid = 'data'.

CLEAR: tabix.

tabix = sy-tabix.

CALL FUNCTION 'SCMS_AO_TABLE_GET'

EXPORTING

arc_id = 'MA'

doc_id = wa_connection-arc_doc_id

comp_id = 'data'

IMPORTING

length = length

TABLES

data = data

  • EXCEPTIONS

  • ERROR_HTTP = 1

  • ERROR_ARCHIV = 2

  • ERROR_KERNEL = 3

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

CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'

EXPORTING

input_length = length

  • FIRST_LINE = 0

  • LAST_LINE = 0

IMPORTING

buffer = buffer

TABLES

binary_tab = data

  • EXCEPTIONS

  • FAILED = 1

  • OTHERS = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

*

CREATE OBJECT cached_response TYPE cl_http_response

EXPORTING add_c_msg = 1.

l_pdf_len = XSTRLEN( buffer ).

*

cached_response->set_data( data = buffer

length = l_pdf_len ).

cached_response->set_header_field(

name = if_http_header_fields=>content_type

value = 'application/pdf' ).

cached_response->set_status( code = 200 reason = 'OK' ).

cached_response->server_cache_expire_rel( expires_rel = 180 ).

CALL FUNCTION 'GUID_CREATE'

IMPORTING

ev_guid_32 = guid.

CASE tabix.

WHEN 1.

CONCATENATE runtime->application_url '/' guid '.pdf' INTO display_url1.

cl_http_server=>server_cache_upload( url = display_url1

response = cached_response ).

WHEN 2.

CONCATENATE runtime->application_url '/' guid '.pdf' INTO display_url2.

cl_http_server=>server_cache_upload( url = display_url2

response = cached_response ).

WHEN 3.

CONCATENATE runtime->application_url '/' guid '.pdf' INTO display_url3.

cl_http_server=>server_cache_upload( url = display_url3

response = cached_response ).

ENDCASE.

ENDLOOP.

Reward if useful!

Former Member
0 Kudos

Hi

t.code SFP.

definition:

Interactive Forms based on Adobe software is SAP's new solution for forms development. Its first release has the focus on interactive use of forms. High-volume printing is supported in principle, but - being a new solution - the performance has not yet reached the same level as Smart Forms or SAPscript, two established solutions that had years to grow. Interactive Forms is the only solution that will continue to be enhanced with new features, while SAPscript and Smart Forms will be supported without limitations.

When (or if) to move to Interactive Forms depends on your requirements. For interactive forms usage, i.e. the new functions, you have no choice, as the existing solutions don't support it. High-volume print scenarios need to be carefully analyzed to see whether your concrete requirements can be met at this point.

However, it is possible to move to Smart Forms and design your forms in such a way that a migration at any point in the future would be but a small step. Smart Forms offers from Web AS 6.40 a migration wizard to Interactive Forms. Technically, everything can be migrated, but we recommend against things like ABAP program nodes, for example.

You are not forced to ever go to Interactive Forms if you don't want to. It really depends on whether your client needs any of the new features in Interactive Forms. Also, if they are currently working with JetForms, they could enquire with Adobe directly what migration path they offer to the joint solution.

go thru this links

http://help.sap.com/saphelp_nw04/helpdata/en/d2/4a94696de6429cada345c12098b009/frameset.htm

example

To get an overview idea about Adobe forms ,

Using SFP , first you need to create a interface . in interface you can declare the import and export parameters and also the declaration part, coding etc : This is nothing but similar to Function module interface.

And now we have to create the Form which is interactive. Create the form and enter the interface name which you have created in first step, so that the parameters , declarations of fields etc : will be copied and available in the form layout. So that you can drag and drop these declared fields ( dclared fields of interface ) to the layout.

Create the context and layout in the form.

The layout generated can be previewed and saved as PDF output.

Now we need to integrate the driver program and the PDF form to get the final output as per the requirement.

On activating and executing the form you will get a function module name just similar to smartforms.

The driver program needs to call this FM.

Refer to the below sample code :

DATA : is_customer TYPE scustom.
DATA : it_bookings TYPE ty_bookings.
DATA : iv_image_url TYPE string.
DATA : iv_sending_country TYPE adrc-country.
DATA : it_sums TYPE TABLE OF flprice_t.
DATA : docparams TYPE sfpdocparams.
DATA : formoutput TYPE fpformoutput.
DATA : outputparams TYPE sfpoutputparams.
PARAMETERS : pa_cusid TYPE scustom-id.

SELECT SINGLE * FROM scustom INTO is_customer
WHERE id = pa_cusid.

SELECT * FROM sbook
INTO CORRESPONDING FIELDS OF TABLE it_bookings
WHERE customid = pa_cusid.

outputparams-nodialog = 'X'.
outputparams-getpdf = 'X'.
*outputparams-adstrlevel = '02'.

CALL FUNCTION 'FP_JOB_OPEN'
CHANGING
ie_outputparams = outputparams
EXCEPTIONS
cancel = 1
usage_error = 2
system_error = 3
internal_error = 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.

docparams-langu = 'E'.
docparams-country = 'US'.
docparams-fillable = 'X'.

CALL FUNCTION '/1BCDWB/SM00000043'
EXPORTING
/1bcdwb/docparams = docparams
is_customer = is_customer
it_bookings = it_bookings
* IV_IMAGE_URL =
iv_sending_country = 'US'
* IT_SUMS =
IMPORTING
/1bcdwb/formoutput = formoutput
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3
OTHERS = 4
.
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 'FP_JOB_CLOSE'
* IMPORTING
* E_RESULT =
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3
OTHERS = 4
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

see these links..

https://www.sdn.sap.com/irj/sdn/interactiveforms-elearning

/people/thomas.jung3/blog/2005/07/13/lessons-learned-from-adobe-forms-development

/people/community.user/blog/2006/11/20/search-help-in-isr-adobe-forms

/people/franklin.herbas/blog/2005/12/13/2d-barcode-pdf-forms-with-sap-netweaver

/people/vani.krishnamoorthy/blog/2006/05/17/fillable-adobe-forms-using-abap

http://help.sap.com/saphelp_nw04s/helpdata/en/43/849b3482206353e10000000a11466f/frameset.htm

http://help.sap.com/saphelp_nw04s/helpdata/en/43/82538c0c4458bbe10000000a422035/frameset.htm

http://help.sap.com/saphelp_nw04s/helpdata/en/46/55c841d202c317e10000000a155106/frameset.htm

http://help.sap.com/saphelp_nw04s/helpdata/en/6d/bd2d828aa04eeb9451aad0d02ae9a0/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/dd/60694fddb74ad88cdb7d2a094f3dd2/frameset.htm

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/d4fe7fca-0b01-0010-569a-9a9...

https://www.sdn.sap.com/irj/sdn/docs?rid=/webcontent/uuid/7c3bc67e-0c01-0010-dbb3-908315896909 [original link is broken] [original link is broken]

https://www.sdn.sap.com/irj/sdn/docs?rid=/webcontent/uuid/7c3bc67e-0c01-0010-dbb3-908315896909 [original link is broken] [original link is broken]

/people/vani.krishnamoorthy/blog/2006/05/17/fillable-adobe-forms-using-abap

https://www.sdn.sap.com/irj/sdn/interactiveforms

http://www.sap.com/company/press/press.epx?pressID=2785

http://www.adobe.com/enterprise/partners/sap.html

http://www.adobe.com/enterprise/partners/pdfs/sap_datasheet.pdf

Reward all helpfull answers

Regards

Pavan