Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata
Error rendering macro 'code': Invalid value specified for parameter 'lang'
DATA: LT_XML TYPE STRING,
           LT_SCHEMA TYPE STANDARD TABLE OF STRING.
DATA LS_GOALS TYPE ZGOALS.
FIELD-SYMBOLS: <LZ_SCHEMA> LIKE LINE OF LT_SCHEMA.
DATA : LV_UPLOAD TYPE STRING VALUE 'Upload the XML',
       LV_RC TYPE I,
       LT_FILETABLE TYPE FILETABLE,
       LS_FILETABLE LIKE LINE OF LT_FILETABLE,
       LV_FILE TYPE STRING,
       LV_FILELENGTH TYPE I.
DATA: BEGIN OF LS_XML OCCURS 0,
        F TYPE STRING,
       END OF LS_XML.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
PARAMETERS : P_FILE TYPE STRING OBLIGATORY,
             GOAL TYPE DTS_DTE_GOAL_NAME.
SELECTION-SCREEN END OF BLOCK B1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE .
*Select xml file from disk to upload
  CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
    EXPORTING
      WINDOW_TITLE            = LV_UPLOAD
    CHANGING
      FILE_TABLE              = LT_FILETABLE
      RC                      = LV_RC
    EXCEPTIONS
      FILE_OPEN_DIALOG_FAILED = 1
      CNTL_ERROR              = 2
      ERROR_NO_GUI            = 3
      NOT_SUPPORTED_BY_GUI    = 4
      OTHERS                  = 5.
  READ TABLE LT_FILETABLE INTO LS_FILETABLE INDEX 1.
  LV_FILE = LS_FILETABLE-FILENAME.
  P_FILE = LV_FILE.
START-OF-SELECTION.
*-- Upload the file ------------------------------------------------------------------*
  CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
      FILENAME = P_FILE
    TABLES
      DATA_TAB = LS_XML.
**Create one xml string
  LOOP AT LS_XML.
    CONCATENATE LS_GOALS-XML LS_XML-F INTO LS_GOALS-XML.
  ENDLOOP.
  LS_GOALS-GOALNAME = GOAL.
**Update in database table
  MODIFY ZGOALS FROM LS_GOALS.
  • No labels