cancel
Showing results for 
Search instead for 
Did you mean: 

How to display Adobe Interactive Form from ABAP (not WDABAP)

former_member188032
Participant
0 Kudos

I have created a WD ABAP application that creates an Adobe Interactive Form (ZCI) and submits it for workflow. All of the data on the form is saved in custom itables in the SAP System. The end-users are supposed to save a copy of the form at the last step in the workflow before they "Acknowledge" the task in UWL. Once the acknowledge takes place, they can no longer display the form in UWL. They want an ABAP program that will read the data from the various custom tables and display a "print" version of the form (not interactive).

I am calling FM 'FP_FUNCTION_MODULE_NAME' to get the function module for the form. I then call FM 'FP_JOB_OPEN' with the parameter IE_OUTPUTPARAMS-REQNEW set to ABAP_TRUE. The call to the form FM has the following EXPORTING parameters:

EXPORTING

/1BCDWB/DOCPARAMS =

/1BCDWB/DOCXML =

I understand the /1BCDWB/DOCPARAMS but have no idea what needs to be done to for the /1BCDWB/DOCXML parameter. Can anyone offer any advice or assistance?

Accepted Solutions (1)

Accepted Solutions (1)

OttoGold
Active Contributor
0 Kudos

Hello,

I am not sure if I understand your task, but I read it as "the user wants to see the non-interactive filled form in the ERP (sap gui) window". Is that right? If not, please clarify. If yes:

1) write the data extraction function module

2) write the module as form generator (NAME, JOB, etc.)

3) change parameters of the print like this:

CALL FUNCTION 'ZPDF_SET_OUTPUT_MODE'

CHANGING

FP_OUTPUTPARAMS = fp_outputparams.

where you change it like this:

fp_outputparams-dest = 'ZPDF'.

fp_outputparams-nodialog = 'X'.

fp_outputparams-preview = 'X'.

the result is opening the print form as a result of the report run.

Hope this helps, Otto

Answers (6)

Answers (6)

OttoGold
Active Contributor
0 Kudos

Have you achieved any progress? Maybe you can share your solution/ experience and close the thread:)) thank you Otto

former_member188032
Participant
0 Kudos

We have not yet gotten this to work. The plan is to still pursue this so I will leave the thread open for now and will discuss a solution if we get it to work.

Former Member
0 Kudos

Joyce,

this is really simple - the reason you have that /1BCDWB/DOCXML is because you defined your form interface to have an XML based interface.

While this is great for ABAP Web Dynpro, because the XML is generated for you, this is NOT the case with regular ABAP.

You should choose ABAP Data Dictionary-Based Interface. You will then be able to add tables, structures and fields to your interface.

For instance, here's code from a program where I call the form in regular ABAP



data: ls_worksheet TYPE Zxxx_structure.

* Fill the ls_worksheet structure here.

* Call the generated function module
  CALL FUNCTION ls_function
    EXPORTING
      /1bcdwb/docparams  = fp_docparams
      worksheet          = ls_worksheet
    IMPORTING
      /1bcdwb/formoutput = ls_form_output
    EXCEPTIONS
      usage_error        = 1
      system_error       = 2
      internal_error     = 3
      OTHERS             = 4.

Notice I do not have the /1BCDWB/DOCXML Exporting parameter.

Just change your interface to a Data Dictionary Based, and add the tables/structures/fields to it.

then, go to your calling program, fill them, and pass the data through the Exporting parameter.

former_member188032
Participant
0 Kudos

Robert,

We have a very extensive WD4A/Workflow application developed around this form. Therefore, I can't just change the interface to be based on an ABAP dictionary structure.

I suppose I could copy the form and have an ABAP-based dictionary interface for the copied form. I hate to go that route because I then have to keep the two forms in sync. I would also have to keep the WD Context and the ABAP-based dictionary interface in sync.

I am new to WD ABAP and Adobe Forms so I could very well be missing something or not fully understanding some of the concepts. All comments and suggests are appreciated.

Former Member
0 Kudos

how about creating a WDA that launches your form in read-only mode instead of creating a new ABAP program do that?

OttoGold
Active Contributor
0 Kudos

Hello again,

you have two options: follow the above mentioned tutorial and re-create a printform in a minute with a program that copies the one shown in the tutorial etc. Or you can use the way mentioned in that tutorial at the very end - it is described there how you get the data OUT of the XML from the form. You just do the same the other way around. You´ll populate the structure you use in your interface and use the TRANSFORMATION to create the XML you need. That is the parameter you´re looking for, I hope.

Regards, Otto

Former Member
0 Kudos

Hi,

You want to make your PDF Form Generated by ABAP Program as Interactive .

That is it you should enter the data in the form right.

Then simply Pass

/1BCDWB/DOCPARAMS-FILLABLE = 'X' then it will work as Interactive form even if you execute from ABAP .

Thanks.

UmaS.

former_member188032
Participant
0 Kudos

UmaS.

The form is defined as an interactive form. In this situation, it has been filled out and the data saved to tables. I now want to be able to bring the form up with the data populated from the tables and have the form be display only. The ABAP program will have input parameters that will allow me to read the specific data from the tables to populate the form. My problem is that I don't know how to get the data to the form when I am not launching the form from a WDABAP application.

As I explained earlier, the call to the form FM has the following EXPORTING parameters:

EXPORTING

/1BCDWB/DOCPARAMS =

/1BCDWB/DOCXML =

It is the /1BCDWB/DOCXML parameter that I don't know how to build to pass to the function module.

OttoGold
Active Contributor
0 Kudos

Maybe you can utilize one of the standard reports (check SE38, name like FP_*), I don´t remember the exact name but what is this for: you have a PDF file (blank) = template, you have a XML file with data and you run it to get these two merged into one filled form. Take a look at these standard programs if this solution fits you.

Regards, Otto

OttoGold
Active Contributor
0 Kudos

I mean the ordinary printform coding. Use cool Offline scenario tutorial (data there and back): http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c2567f2b-0b01-0010-b7b5-977cbf806...

I hope you don´t want the form to be interactive, because you would need some "control" application (like WD), so that is not possible. Just a print form/ print preview. You would have to build a WS or something to make that work in sap gui the same way as it works in WD.

Regards, Otto

former_member188032
Participant
0 Kudos

Otto,

I had found the link that you referenced and read thru it. Only problem is that it does not address the /1BCDWB/DOCXML (XSTRING) parameter that is part of the form FM interface. My form has an XML Schema-Based Interface. All business data that is transferred to the from at runtime is passed over with the XSTRING parameter. I don't know how to great that parameter in normal ABAP. My goal is to only have the form display as a Print Form in this case to display the data that was entered and saved from the executiion of a WDABAP application.

former_member188032
Participant
0 Kudos

Otto,

You are correct, I want to display the form from the SAP Gui. Your second steps says: 2) write the module as form generator (NAME, JOB, etc.). This is the part I do not understand. The form FM parameter /1BCDWB/DOCXML is of type XSTRING. I do not know how to get the extracted data into the correct form to pass it in this parameter. Can you can provide a little more detail on that piece or point me to an example?

Thanks!