2014 Dec 15 8:51 AM
Hi friends,
I want to read the data in the XML page by making a connection from SAP to FTP server.I have the data in the ALV form.Whenever I click on a particular record the connection is successfully made to the FTP server and I am able to get the XML page,but when I click on the second or any other records this XML page is not getting refreshed.It is always showing me the first records details.
For this I have used the following logic.
CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
EXPORTING
INPUT_LENGTH = L_BINLEN
IMPORTING
BUFFER = L_BINXSTRING
TABLES
BINARY_TAB = LT_BINDATA
EXCEPTIONS
FAILED = 1
OTHERS = 2.
IF SY-SUBRC NE 0.
RAISE E4.
EXIT.
ENDIF.
CALL SCREEN 9000 STARTING AT 10 200 ENDING AT 180 500.
IF LR_XML_REF IS NOT INITIAL.
CLEAR: LR_XML_REF.
ENDIF.
CL_SWF_WSP_XML_VIEW=>CREATE(
EXPORTING
I_CONTAINER_NAME = 'CONT'
I_REPID = SY-REPID " ABAP Program: Current Main program
I_DYNNR = '9000' " ABAP Program: Number of Current screen
I_XML_STREAM = L_BINXSTRING
IMPORTING
E_XML_VIEW = LR_XML_REF " HTML Control for WSDL Display
).
LR_XML_REF->SHOW( ).
I am clearing all the local variables before reading the second file but still the XML page is not getting refreshed.
Please guide me as to where I am going wrong.I am not able to find out what is missing my logic.
Thanks,
Praveen Raj
Hi friends,
I want to read the data in the XML page by making a connection from SAP to FTP server.I have the data in the ALV form.Whenever I click on a particular record the connection is successfully made to the FTP server and I am able to get the XML page,but when I click on the second or any other records this XML page is not getting refreshed.It is always showing me the first records details.
For this I have used the following logic.
CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
EXPORTING
INPUT_LENGTH = L_BINLEN
IMPORTING
BUFFER = L_BINXSTRING
TABLES
BINARY_TAB = LT_BINDATA
EXCEPTIONS
FAILED = 1
OTHERS = 2.
IF SY-SUBRC NE 0.
RAISE E4.
EXIT.
ENDIF.
CALL SCREEN 9000 STARTING AT 10 200 ENDING AT 180 500.
IF LR_XML_REF IS NOT INITIAL.
CLEAR: LR_XML_REF.
ENDIF.
CL_SWF_WSP_XML_VIEW=>CREATE(
EXPORTING
I_CONTAINER_NAME = 'CONT'
I_REPID = SY-REPID " ABAP Program: Current Main program
I_DYNNR = '9000' " ABAP Program: Number of Current screen
I_XML_STREAM = L_BINXSTRING
IMPORTING
E_XML_VIEW = LR_XML_REF " HTML Control for WSDL Display
).
LR_XML_REF->SHOW( ).
I am clearing all the local variables before reading the second file but still the XML page is not getting refreshed.
Please guide me as to where I am going wrong.I am not able to find out what is missing my logic.
Thanks,
Praveen Raj
2014 Dec 15 10:04 PM
When you select the second record in the ALV LR_XML_REF has been initialised, so it will never update the XML and will always show the original XML.
Remove the statement
IF LR_XML_REF IS NOT INITIAL.
And that should help.
Cheers,
Katan
2014 Dec 16 4:49 AM
Hi Katan,
Thnx for your reply..
I removed that statement as you said( CLEAR: LR_XML_REF as well),but still the XML page is not getting refreshed.It is still showing the first records XML page.
2014 Dec 16 5:52 AM
Hi Kumar,
I've just taken a second look at your code and my original suggestion would not make any impact as you now said. Apologies for this, I misread it initially.
I've looked at the code in the class and it is not too complicated. Have you tried to debug the factory method "CREATE", when you press the second row to display the second XML.
As long as you pass the new XML stream it should call "me->set_xml_stream" in the constructor (which is called directly by factory method "CREATE", when trying to create a new instance of CL_SWF_WSP_XML_VIEW).
When this happens check that the URL instance attribute M_XML_URL is updated. It should be the same URL used when calling the "SHOW" method.
It should be brand new instance and so is odd that the XML would be cached or the screen not refreshed.
Hopefully debugging it should shed some light on your issue.
Cheers,
Katan
2014 Dec 16 6:26 AM
Hi Katan,
Yes katan u r right,I had debugged this issue and found that the M_XML_URL is getting updated each time when a row is selected.For the first record it showed as HTML000003, for 2nd it showed as HTML000006 and so on.
Since it is a standard method how can we maintain the same URL for each record,since its a dynamic value???
2014 Dec 17 4:13 AM
Is there any other alternative solution for resolving this issues?? I have also looked for other standard methods for refreshing the XML page but to no avail.Inputs regarding this will be appreciated.
2014 Dec 19 9:49 AM