cancel
Showing results for 
Search instead for 
Did you mean: 

incorrectly padded postdata with Java GUI

abo
Active Contributor

Followup to abapGit #4832 for frank.krause (see comment)

Using abapGit most of the time with the Java GUI on Linux, I noticed that abapGit would occasionally abort commit depending on the length of the commit description. With the help of marcbernardtools and sandra.rossi this was narrowed down to the GUI returning spurious data in the postdata value from a HTML control.

This does NOT happen with the Windows GUI and it seems to be version-dependent with the Java GUI version as well:

  • 7.50rev9.6 works
  • 7.50rev12 works
  • 7.70rev1 fails
  • 7.70rev4 fails

To reproduce outside of abapGit you may use the following code, courtesy of Sandra Rossi:

CLASS lcl_app DEFINITION.
  PUBLIC SECTION.
    METHODS at_selection_screen_output.
    METHODS at_selection_screen_exit.
    METHODS on_sapevent FOR EVENT sapevent OF cl_gui_html_viewer
          IMPORTING action frame getdata postdata query_table.
  PRIVATE SECTION.
    DATA o_html TYPE REF TO cl_gui_html_viewer.
ENDCLASS.

CLASS lcl_app IMPLEMENTATION.

  METHOD at_selection_screen_output.
    DATA: l_url  TYPE cndp_url,
          l_text TYPE string.

    IF o_html IS NOT BOUND.

      CONCATENATE '<html><head></head><body>'
      '<form id="form" method="POST" action="SAPEVENT:submit">'
      '<p>Text : <input name="text" type="text" length="50" value="'
      '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'
      '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'
      '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'
      '"></p>'
      '<p>Checkbox : <input name="checkbox" type="checkbox"></p><p><button type= "submit">ABAP call</button></p>'
      '</form>'
      '</body></html>'
      INTO l_text.

      o_html = new #( parent = cl_gui_container=>screen0 ).
      SET HANDLER on_sapevent FOR o_html.
      o_html->set_registered_events( events = value #( ( eventid = o_html->m_id_sapevent ) ) ).
      DATA(lt_text) = cl_bcs_convert=>string_to_soli( l_text ).
      o_html->load_data(
        EXPORTING type = 'text' subtype = 'html' size = strlen( l_text )
        IMPORTING assigned_url = l_url
        CHANGING  data_table = lt_text ).
      o_html->show_url( EXPORTING url = l_url ).
    ENDIF.
  ENDMETHOD.

  METHOD at_selection_screen_exit.
    IF o_html IS BOUND.
      o_html->free( ).
      FREE o_html.
    ENDIF.
  ENDMETHOD.

  METHOD on_sapevent.
    CONCATENATE LINES OF postdata INTO data(l_post_data) RESPECTING BLANKS.
    MESSAGE l_post_data TYPE 'I'.
  ENDMETHOD.

ENDCLASS.

PARAMETERS dummy.
DATA go_app TYPE REF TO lcl_app.

LOAD-OF-PROGRAM.
  CREATE OBJECT go_app.

AT SELECTION-SCREEN OUTPUT.
  go_app->at_selection_screen_output( ).

AT SELECTION-SCREEN ON EXIT-COMMAND.
  go_app->at_selection_screen_exit( ).

The issue depends on the length on the text: 2 lines show the spurious padding, while 3 are ok, for example.

So, question is: can anyone at SAP verify this? How do we get this fixed?

Accepted Solutions (1)

Accepted Solutions (1)

RMW
Advisor
Advisor
0 Kudos

Hello Andrea,

Could you please create a support incident on component BC-FES-JAV and provide traces both from a working SAP GUI for Java 7.50 version and SAP GUI for Java 7.70 rev 4 and activate following trace keys:

EVENT
CALL
HTML
HTML2
HTMLDUMP

For information on tracing please refer to note 683960 - The most common traces for SAP GUI for Java

Thanks and best regards
Rolf-Martin

abo
Active Contributor
0 Kudos

Rolf, thanks for the reply. In my case this might be a problem: I do not use the Java GUI at work, only at home in my free time.

(for issues related to the Windows GUI, in fact, I have already opened two incidents, one closed with a fix)

It would be super if you could try the sample code above and see if you can reproduce the problem; I'll ask on GH if someone is using the Java GUI professionally, they might be able to file the report.

Sandra_Rossi
Active Contributor

Hi Rolf-Martin, thank you, I have created a ticket with all the details from Andrea (trace, steps to reproduce), if you want to have a look at it, I can private message you the ticket number.

Regards. Sandra

RMW
Advisor
Advisor

Hello Sandra,

Thank you for the ticket, I was able to find it.

Best regards

Rolf-Martin

abo
Active Contributor
0 Kudos

sandra.rossi rolf-martin.woersinger please let me know when a new release comes out which includes a fix, so that I may test it and then undo the workaround added in abapGit, thank you in advance.

Sandra_Rossi
Active Contributor

Hello c5e08e0478aa4727abc4482f5be390b2, the ticket is still "in processing by SAP", last news December 12th, I have added a comment to obtain some news.

Sandra_Rossi
Active Contributor

Update from SAP:

"We finally have been able to look into the issue and found the reason. The fix is planned to be part of 7.70 rev 5. "
abo
Active Contributor
0 Kudos
sandra.rossi

thanks for the update; regarding the last quesion in the bugreport, I'll be glad to test the fix if they wish for extra confirmation, otherwise I'll just wait for the official release.

Sandra_Rossi
Active Contributor

c5e08e0478aa4727abc4482f5be390b2

Done. I'll tell you when I'm informed of the beta version. Or maybe Rolf-Martin can directly contact you. Let's see.

RMW
Advisor
Advisor

Hello Andrea,

As part of the incident Sandra submitted, we have now provided a version containing the fix for the postdata issue for testing . We would be glad to get feedback on this.

Best regards

abo
Active Contributor
0 Kudos

7.70rev4.7 works correctly, that's great!

Now I can go back to using it for abapGit, yay! 🙂

(edit: yes, I double-checked that rev4 still showed the issue, I do not trust my memory)

Answers (0)