cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get the value saved from drop down list in pdf.

former_member203117
Active Participant
0 Kudos

Dear Team,

I have a offline pdf form. The user selects few values from drop down list and enters few values in the text field and saves the adobe pdf form. I'm following the below steps to upload the pdf file and extract the values..

.             Upload the PDF file using Function Module ‘GUI_UPLOAD’.

               Instantiate the PDF object and assign the PDF file to this PDF object 

  • Get the reference to form processing (FP) class using the interface IF_FP. 
  • Get the reference of PDF object class using interface IF_FP_PDF_OBJECT. 
  • Create the PDF object using the method ‘CREATE_PDF_OBJECT’ defined in the interface IF_FP
  • Set our PDF in the created PDF object using method SET_DOCUMENT of the interface ‘IF_FP_PDF_OBJECT’.
  • Extract the data from PDF object using the method ‘SET_EXTRACTDATA’ of the interface IF_FP_PDF_OBJECT. 
  • Call the Adobe Document Service (ADS) using the method EXECUTE defined in the interface ‘IF_FP_PDF_OBJECT’.   

              Extract the data from PDF Object by method called GET_DATA defined in the interface’ IF_FP_PDF_OBJECT’.

            The extracted data is in XML format. We have to convert XML data to ABAP internal table using the Function Module ‘SMUM_XML_PARSE’

After parsing I see all the values of the dropdown in the internal table. But I want the value selected and saved. Can anyone please guide me how to achieve this.ANy help would be deepl appreciated.

Regards,

Tushar.

Accepted Solutions (1)

Accepted Solutions (1)

former_member203117
Active Participant
0 Kudos

Dear Team,

I tried using the below scripts during different events,

Change Event:-

var myNewValue = this.boundItem(xfa.event.newText);

save Event :-

data.vendor.Name.Table1.Row1.TITLE.clearItems();

data.vendor.Name.Table1.Row1.TITLE = myNewValue;

After I save the form and reopen again I see all the values though I have cleared it. Can anyone please suggest me a solution, any hekp would be deeply appreciated.

Regards,

Tushar.

Former Member
0 Kudos

Dear Tushar,

I am getting same problem did you find any solution for this issue.

Please guide me.

Thanks in advance...

Best Regards,

Ram.

Former Member
0 Kudos

Hey Ram,

Normally when you use the FM SMUM_XML_PARSE to fill the internal table, you will notice that all the values of the drop down are visible.

To solve this issue, what I did is I created a table with as many fields as there are drop down list and hid the table from the layout. In the drop down UI's change event I captured the value selected in the drop-down list and updated any one of the table box raw value with the captured value. So when you parse using FM SMUM_XML_PARSE you will notice the new table and the values selected in the drop down list. There might be a better and direct way to achieve this, but I used this logic to capture the drop down value selected.

Change Event:- (drop down list UI)

var myNewValue = this.boundItem(xfa.event.newText);

table1.row1.XXXX.rawValue = myNewValue;

XXXX --> the field name given to the box of the table.

I used table instead of 10 text value UI's, I had around 10 drop down list. If you have one drop downlist you can use one text UI and hide it. when you use the FM SMUM_XML_PARSE the UI will be visible in the internal table.

Best of luck, I hope it helps.

Regards,

Tushar.

Former Member
0 Kudos

Hi Tushar,

Thank you for your early response.

As per your suggestion, I have written the below java script code in my form :

var land1 = xfa.event.newText;

data.vendor.pdfout.Row1.LAND1.rawValue = land1;

Eg:

CALL FUNCTION 'SMUM_XML_PARSE'

     EXPORTING

       XML_INPUT = XML_DATA

     TABLES

       XML_TABLE = T_PER_INFO

       RETURN    = T_RETURN.

But still i am unable to get selected value from the drop down list.

Is there any other custom property that we need to set for achieving this?

Please guide me with proper sequence of steps on this.

Thanks in advance.

Regards,

Ram


Former Member
0 Kudos

Dear Ram,

Please debug the program and check the internal table T_PER_INFO, I'm sure it should be there; the table or the text field you have declard in the PDF form.

Regards,

Tushar.

Former Member
0 Kudos

Dear Ram,

Write the code in

Change Event:- (drop down list UI) also you have written the incorrect code, your code is as follows.

var land1 = xfa.event.newText;

data.vendor.pdfout.Row1.LAND1.rawValue = land1;

But I used the code.

var myNewValue = this.boundItem(xfa.event.newText);

table1.row1.XXXX.rawValue = myNewValue;

You have forgotten this.boundItem.

Please try by changing the code and debug the internal table T_PER_INFO, I'm sure it should be there; the table or the text field you have declard in the PDF form.

Regards,

Tushar.

Former Member
0 Kudos

Thanks a lot Tushar!!!!

My issue is solved. your code is working fine. will give full points.

Regards,

Ram.

Answers (0)