Update terminated in CL_GUI_FRONTEND_SERVICES= FILE_SAVE_DIALOG

Hi Guys,
I am saving Invoice Output type into local PDF file and using CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG to give user the choice where to save the file. It gives an abap short dump "Access not possible using 'NULL' object reference". and update is terminated in the same method.
I think output types are executing in Update Taks.
It's working fine when used in other programs(Normal)
Suggestions are Welcome. Thanks! Vijender
The code is :
  CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
    EXPORTING
      WINDOW_TITLE         = 'Save PDF File'
      DEFAULT_EXTENSION    = 'PDF'
      DEFAULT_FILE_NAME    = LV_NAME_INIT
      FILE_FILTER          = '*.PDF'
      INITIAL_DIRECTORY    = 'C:'
     PROMPT_ON_OVERWRITE  = 'X'
    CHANGING
      FILENAME             = LV_FNAME
      PATH                 = LV_PATH_FOLDER
      FULLPATH             = LV_FILE_NAME
    EXCEPTIONS
      CNTL_ERROR           = 1
      ERROR_NO_GUI         = 2
      NOT_SUPPORTED_BY_GUI = 3
      OTHERS               = 4.

HI, Viraylab
Use the Logic Bellow it will solve out your problem, using following you must provide a file name other wise after selecting Cancel button this dialog will appear again.
PERFORM save_dialog.
*&      Form  save_dialog
*       text
FORM save_dialog.
  DATA: filename TYPE string,
        path TYPE string,
        fullpath TYPE string.
  CALL METHOD cl_gui_frontend_services=>file_save_dialog
    EXPORTING
      window_title         = 'Select File Name'
    CHANGING
      filename             = filename
      path                 = path
      fullpath             = fullpath
    EXCEPTIONS
      cntl_error           = 1
      error_no_gui         = 2
      not_supported_by_gui = 3
      OTHERS               = 4.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
  IF filename IS INITIAL.
    PERFORM save_dialog.
  ENDIF.
ENDFORM.                    "save_dialog
Please Reply if any Issue,
Best Regards,
Faisal

Similar Messages

  • Update termination during Periodic Posting in RE-FX

    Hi,
    I am getting a update termination error -SAPSQL_ARRAY_INSERT_DUPREC during periodic posting for Lease Out Contract. Tcode - RERAPP
    We use deferred tax. This functionality is used to transfer service tax
    credit from interimn account to final account as applicable in India.
    As suggested in the note 913805 by SAP we deleted the BTE's in application Key FI-TAX
    Inspite of that we get the same update error.
    Also we observed that after deleting the BTE's our service tax credit
    functionality is also not working.
    Further I have observed the following:
    I am getting error only while posting contracts with service tax.
    Tax Code L1 Account Key OS1 & OS2 & OS3
    Please help me in finding a soultion to this.
    Thanks & Regards
    Sanjay

    Hi,
    The transfer step will transfer controlling assignments from the contract to the rental objects. This is useful if you want to run the controlling reports in order to see a P&L statement for a Building for example.
    Regards,

  • Update termination error at the time of order creation and chamge?

    Dear gurus,
    Facing an error at the time of creation of order.
    system is giving update termination error & when we are going in change mode of that order system is giving an error message " SD document XXXX is not in the database or has been achieved"
    please treat on priority
    regards,
    krai

    Hi,
    Goto ST22 T.Code and analyse the error.The error message why it is terminated will be displayed here.
    Or go to SBWP T.Code in the user where you got this error and check the inbox.
    It will display why the error is appearing.
    Show the same to the ABAPer and ask them to work on it.
    I think your server may be slow and it will take some time to update the order created by you.But I am not sure.Check the error message.
    Regards,
    Krishna.

  • Update termination error at the time of order creation

    Dear gurus,
    Facing an error at the time of creation of order.
    system is giving update termination error & when we are going in change mode of that order system is giving an error message " SD document XXXX is not in the database or has been achieved"
    please treat on priority
    regards,
    krai

    Hello ,
    "Update terminated " error has two reasongs.
    First is system update  was not active and hence terminated
    For this to check Goto the transaction code SM13  and  check whether the SYSTEM UPDATE is active or not.
    If it is active ,
    Then click on the Option TOBE updated in the status  and execute, then in the next screen you can find some list of documents that are not updated and causing error .
    Click on MODULES in the screen and find the erro which causing this error.
    Most this kind of error will happen if something in the Funcion Module or USER EXIT is missing.
    Please check and revert back if you need further details
    Also check the link
    http://help.sap.com/saphelp_nw04/helpdata/en/e5/de870535cd11d3acb00000e83539c3/frameset.htm
    regards,
    santosh

  • While saving service work order Update termination

    Hi Friends,
    We have a service order integration with Notifications. First we create a Notification and in turn create as service order.
    When the order is saved it goes for a update termination and the error message is " 00 671: ABAP/4 processor: DBIF_RSQL_INVALID_RSQL "  for IW52 transaction. Actually when we save it provides the order number but never gets updated in the data base.
    Again when we create the order from Notification for the second time, order gets created by skipping a number. For example when we save the order if the ordewr number is 902345 where it is not created , then when we create again the order number is 902346.
    Have any one come across such terminations in IW52 for IW32?
    Regards,
    Selva

    Friends,
    At last my problem was resolved as it was escalated to SAP and SAP analysed as below,
    This problem is caused becuase of the error in database interface. As the database server and the application server is a mix of platforms with different internal character data representations, this error occurs,
    The work around solution as narrated below,
    " For this we need to set the following parameters on the Default and Instance Profiles:
    Profile Name                            Parameter name         Current Value     Recomm by SAP
    DEFAULT.PFL                           rdisp/vbname              not set           rdisp/vbname=$(rdisp/myname)
    CRH DVEBMGS00 cr1apod        rdisp/wp no vb               2                  Greater than 0
    CRH DVEBMGS00 cr1apod        rdisp/vb dispatching        1                  Set to 0
    crap0 CRH 20                            rdisp/wp no vb                4                  Greater than 0
    crap0 CRH 20                            rdisp/vb dispatching        1                  Set to 0
    Inorder to reflect all the changes, System CRH-202 needs to be restarted. Basis have done the above changes through T.Code: RZ11 and CRH indicates the Quality client.
    So the profile paprameters will be different in each of SAP systems.
    Hope this will be very useful for future reference to all of us.
    Regards,
    selva

  • STATUS_UPDATE error to update USER STATUS - Update termination error

    Hi All,
    I am using status_update FM in sales order user exit MV45AFZZ in a perform routine for updating user status in line item for sales order. There are 4 custom statuses created for the sales order line item. 1,2 3, and 4 by configuration. My job is to select one of those based on user selection.
    Scenario: During change order process using  VA02, I have to change the existing status to a third status when user selects the second one. That is for example, in VA02, user selects status 4 from previous status 3, and save, I have to make the status 4 inactive and save the new status 2 instead of 3 though user selected 3. How do I achieve this.?  ????Any programming example is really appreciated. Thanks!!!
    I am right now using STATUS_READ and reading the existing status 4. Then making it inactive using status_update FM. And updating the new status 2 as active one and 3 as inactive again. Two inactive updates and one active update is throwing an update termination error while saving the sales order.
    Any help is really appreciated. 
    Thanks
    Ricky

    Hi ricky,
    For saving any changes you need to have a Z-table.
    In programs we can't store the user selection. In your case you can create a z-table and store the status there and delete the last status. The process would be faster as you will always have one record in the table.
    . One more advantage is you can even track the changes through the Z-table(User who is changing it.)
    Hope this solution will surely help you.
    Cheers
    Suvi

  • FSCM via WS-RM (without PI ) - Update termination issue

    Hello experts .
    We are trying to integrate SD with FSCM ( credit management) using WS-RM (without PI).
    Details of the issue and steps followed so far.
    Ideal Scenario :
    Once we create / change a sales order ( in SD ) , the interface Creditworthinessquery_out (WS Consumer ) gets triggered (in SD) and the subsequent response CREDITWORTHINESSQUERY_IN(Provider) is triggered from FSCM (with the details of creditworthiness).Once the query response in received an notification is triggered from SD to FSCM (asynchronous service).
    After receiving the query response the functionality of credit check happens while creating / changing the sales order .
    Configuration steps followed in SOAMANAGER
    We have created end points for all the relevant service interfaces (Providers) , and also created logical ports for the respective consumers.
    During the creation of logical ports - for the consumers we used the WSDL (of the providers) as the inbound message action.
    (This has been done to all the services query , notification that are relevant in our integration).
    Current behavior / issue .
    While creating sales order the sales order is not getting saved (getting updated in the database).System allows us to complete the sales order creation process and also we get a message as sales order saved successfully. But then there is a update terminated express document that pops up. Sales order is not getting updated in the database.
    When I see the logs/traces in SOAMANAGER I see that the query out is successful , query in has the right response (in warning state though) . But no notification is being triggered ?? 
    How to overcome this update termination issue ?
    When we see the SM13 log , it points to SLD issue (LCR 010: Internal error in SLD API). why do we need a SLD without PI

    Hi  ,
    Finally we are able to solve the update termination issue . But again we are using a work around .
    Situation :
    Once we executed the VA01 transaction we were getting update termination issue . After lots of debuggung we found that system was trying to get the Business system details ( Own business system data ) . The table lcrt_clntcache had no values.
    Solution
    We inserted appropriate values in the Table LCRT_CLNTCACH (business system data ) and now it works .This is a work around we got as of now.Credit checks are happening successfully and also integration is good .
    (typically if we define business system in SLD (PI) , and run SLD_CHECK , this table gets populated , but in our case we are not using PI instead we are using WS-RM)
    But now few questions arise .
    a) Why do we need a business system in case we are not using PI ( typically we define business system and technical system in PI )  and instead using WS-RM ?
    b) Is it a good practice to update the table ( as did in workaround above )?
    c) Is this any bug and needs to be consulted with SAP ?
    Please let me know your views .
    Edited by: Vedula Adeep on Jan 16, 2012 8:42 AM

  • Integrating SD with FSCM using WS-RM - Update Termination error

    Hello experts .
    We are trying to integrate SD with FSCM ( credit management) using WS-RM (without PI).
    Details of the issue and steps followed so far.
    Ideal Scenario :
    Once we create / change a sales order ( in SD ) , the interface Creditworthinessquery_out (WS Consumer ) gets triggered (in SD) and the subsequent response CREDITWORTHINESSQUERY_IN(Provider) is triggered from FSCM (with the details of creditworthiness).Once the query response in received an notification is triggered from SD to FSCM (asynchronous service).
    After receiving the query response the functionality of credit check happens while creating / changing the sales order .
    Configuration steps followed in SOAMANAGER
    We have created end points for all the relevant service interfaces (Providers) , and also created logical ports for the respective consumers.
    During the creation of  logical ports -  for the consumers we used the WSDL (of the providers) as the inbound message action.
    (This has been done to all the services query , notification that are relevant in our integration).
    Current behavior / issue .
    While creating sales order the sales order is not getting saved (getting updated in the database).System allows us to complete the sales order creation process and also we get a message as sales order saved successfully. But then there is a update terminated express document that pops up. Sales order is not getting updated  in the database.
    When I see the logs/traces in SOAMANAGER I see that the query out is successful , query in has the right response (in warning state though) . But no notification is being triggered ?? 
    How to overcome this update termination issue ?
    When we see the SM13 log , it points to SLD issue (LCR 010: Internal error in SLD API). why do we need a SLD without PI ?

    Hi ,
    Can you tell me more details of how you are testing this ? I was successfully able to impilment this solution (credit management using ws-rm in ehp5). If you can give me more details i can surely try to help .

  • Disable 'Cancel' button in cl_gui_frontend_services= file_save_dialog...

    Hello Experts,
    Is there a way to disable the 'Cancel' button in method 'FILE_SAVE_DIALOG' of class
    cl_gui_frontend_services? Because in our requirement, the saving of the file is mandatory.
    Thank you guys and take care!

    HI, Viraylab
    Use the Logic Bellow it will solve out your problem, using following you must provide a file name other wise after selecting Cancel button this dialog will appear again.
    PERFORM save_dialog.
    *&      Form  save_dialog
    *       text
    FORM save_dialog.
      DATA: filename TYPE string,
            path TYPE string,
            fullpath TYPE string.
      CALL METHOD cl_gui_frontend_services=>file_save_dialog
        EXPORTING
          window_title         = 'Select File Name'
        CHANGING
          filename             = filename
          path                 = path
          fullpath             = fullpath
        EXCEPTIONS
          cntl_error           = 1
          error_no_gui         = 2
          not_supported_by_gui = 3
          OTHERS               = 4.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      IF filename IS INITIAL.
        PERFORM save_dialog.
      ENDIF.
    ENDFORM.                    "save_dialog
    Please Reply if any Issue,
    Best Regards,
    Faisal

  • Question for cl_gui_frontend_services= file_save_dialog

    Hi Expert.
    I made simple test page.
    there is nothing but this code in oninitlization
    * event handler for data retrieval
      DATA: ld_filename TYPE string,
            ld_path TYPE string,
            ld_fullpath TYPE string,
            ld_result TYPE i.
    * Display save dialog window
      CALL METHOD cl_gui_frontend_services=>file_save_dialog
        EXPORTING
    *      window_title      = ' '
          DEFAULT_EXTENSION = 'XLS'
          default_file_name = 'accountsdata'
          INITIAL_DIRECTORY = 'c:temp'
        CHANGING
          filename          = ld_filename
          path              = ld_path
          fullpath          = ld_fullpath
    * Check user did not cancel request
      CHECK ld_result EQ '0'.
    and that shows
    "method:FILE_SAVE_DIALOG ,line : 164
    An attempt was made to execute a dynamic method callon an initial(NULL-) object reference. The reference must refer to an object."
    why this error caught?
    Did I miss something or made mistake BSP code above?
    should I create some object before call cl_gui_frontend_services=>file_save_dialog?
    I don't have any clue on this.
    help me please. thanks .

    Oh yes - this most certainly will not work from BSP.  This class and any other that uses the control framework are written as proxy objects to code that actually executes as part of the SAPGui on the client machine.
    BSP is completly web centric.  Its output can only be ran in a browser.  To the browser the output of BSP doesn't look any different than any other web page that might come from ASP, JSP, PHP, etc. 
    Also because BSP runs in a browser - the amount of interaction that can occur with the client (particularly around file downloads) is somewhat limited. There is no file download element or a file save as dialog object. There are other ways to attach content to an HTTP Response or place it in a hidden iFrame - the browser is then responsible for intrepting this information and offering the file save as or open dialog based upon the appropriate MIME Type. 
    This weblog is the primer on BSP downloads written by the Jedi Master himself:
    <a href="/people/mark.finnern/blog/2003/09/23/bsp-programming-handling-of-non-html-documents:///people/mark.finnern/blog/2003/09/23/bsp-programming-handling-of-non-html-documents
    If you search you will find other examples in the older BSP weblogs as well.

  • CALL METHOD cl_gui_frontend_services= file_save_dialog

    Hi,
    I want to use 'CALL METHOD cl_gui_frontend_services=>file_save_dialog', to choose a path for saving my txt files.  I only want the user to be able to choose the path and not have to supply a filename aswell.  My filenames are standard in the program and I don't want them to be changed by the user.
    Is there another method which is designed for this or is there a simple parameter I have missed?
    Thanks and regards,
    Simon.

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_f.
       PERFORM f_search_help_pa_f1.
    FORM f_search_help_pa_f1 .
       CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
         EXPORTING
           program_name  = sy-repid
           dynpro_number = sy-dynnr
         CHANGING
           file_name     = pa_f
         EXCEPTIONS
           mask_too_long = 1
           OTHERS        = 2.
       IF sy-subrc <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
       ENDIF.
    ENDFORM.                    " f_search_help_pa_f1
    Try this
    Regards

  • Cl_gui_frontend_services= file_save_dialog?

    Hi All,
    Im trying to use the below method, what are all the parameters need to fill and hw to declare those parameters.
    CALL METHOD cl_gui_frontend_services=>file_save_dialog
    EXPORTING
       WINDOW_TITLE         =
       DEFAULT_EXTENSION    =
       DEFAULT_FILE_NAME    =
       FILE_FILTER          =
       INITIAL_DIRECTORY    =
       WITH_ENCODING        =
       PROMPT_ON_OVERWRITE  = 'X'
      CHANGING
        filename             =
        path                 =
        fullpath             =
       USER_ACTION          =
       FILE_ENCODING        =
    EXCEPTIONS
       CNTL_ERROR           = 1
       ERROR_NO_GUI         = 2
       NOT_SUPPORTED_BY_GUI = 3
       others               = 4
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Puppy.

    Hi ,
    copy this code and try this , after executing this code ypu will get the path into  "  lv_fullpath " .
    and then pass this lv_fullpath to next function module like gui_download .
      DATA:   v_name  TYPE string,
              v_file  TYPE rlgrap-filename,
              lv_filename    TYPE string,
              lv_filen       TYPE string,
              lv_path        TYPE string,
              lv_fullpath    TYPE string.
    *  MOVE v_name TO lv_filename.
      CALL METHOD cl_gui_frontend_services=>file_save_dialog
        EXPORTING
    *     WINDOW_TITLE         =
    *     DEFAULT_EXTENSION    =
    *    default_file_name    = lv_filename
    *     WITH_ENCODING        =
    *     FILE_FILTER          =
    *     INITIAL_DIRECTORY    =
    *     PROMPT_ON_OVERWRITE  = 'X'
        CHANGING
          filename             = lv_filen
          path                 = lv_path
          fullpath             = lv_fullpath
    *     USER_ACTION          =
    *     FILE_ENCODING        =
        EXCEPTIONS
          cntl_error           = 1
          error_no_gui         = 2
          not_supported_by_gui = 3
          OTHERS               = 4
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    Regards,
    Aby.

  • Cl_gui_frontend_services= file_save_dialog - how to admit JUST .txt ext

    hi all, i'm using the: cl_gui_frontend_services=>file_save_dialog class and method..
    My question, how can i do for RESTRICT the file extension of the file JUST to '.txt' ?? if the user select the name of the file to create to 123.pdf -for example- that the system don't let him to continue, or just add the txt extension to the final of the filename.. -like 123.pdf.txt ??
    Thanks!!

    Hi Pampeano,
    i I have  created a small code snippet :-
    LV_FILENAME TYPE STRING,
    LV_FULLPATH TYPE STRING,
    LV_PATH TYPE STRING,
    LV_ACTION TYPE I,
    LV_FILE TYPE STRING,
    DEFAULT_EXTENSION TYPE STRING.
    if DEFALUT_EXTENSION  ne 'TXT'.
    eRROR ........
    ENDIF.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
    EXPORTING
    WINDOW_TITLE = 'Please select the location'
    DEFAULT_EXTENSION = DEAFAULT_EXTENSION
    DEFAULT_FILE_NAME = LV_FILE
    FILE_FILTER = '*.TXT'
    CHANGING
    FILENAME = LV_FILENAME
    PATH = LV_PATH
    FULLPATH = LV_FULLPATH
    USER_ACTION = LV_ACTION
    EXCEPTIONS
    CNTL_ERROR = 1
    ERROR_NO_GUI = 2
    OTHERS = 3.
    Regards
    Abhii
    Edited by: Abhii on Aug 17, 2010 7:44 AM
    Edited by: Abhii on Aug 17, 2010 7:44 AM
    Edited by: Abhii on Aug 17, 2010 7:44 AM
    Edited by: Abhii on Aug 17, 2010 7:46 AM

  • Question on cl_gui_frontend_services= file_save_dialog

    Hi all,,,  need your help.. thank you i n ad vance ..
    why ist tht happen?  the default extension, 'txt'
    but  the "save as type" in the dialog box  shows 'XLS', excel file ??
    CALL METHOD cl_gui_frontend_services=>file_save_dialog
        EXPORTING
          window_title      = 'Save file to'
          DEFAULT_EXTENSION = 'txt'
          default_file_name = v_filename
          INITIAL_DIRECTORY = 'c:\'
        CHANGING
          filename          = t_file
          path              = ld_path
          fullpath          = ld_fullpath
          user_action       = ld_result.

    you can do in this way....
    in this case default is 'XLS' and he can choose all the files.
    CALL METHOD cl_gui_frontend_services=>file_save_dialog
        EXPORTING
          window_title      = l_title
          default_extension = 'XLS'
          file_filter       = ' '
        CHANGING
          fullpath          = l_fullpath
          path              = l_path
          filename          = l_filename
        EXCEPTIONS
          OTHERS            = 1.
    Regards
    Vijay

  • F-44 Vendor Clearing Update Terminated

    Dear All,
                  When we try clearing Open Line Items of a particular Vendor, system posts the document but eventually produces an ABAP RunTIme Error with Update Terminated Error. The line items remain as open items instead of getting cleared.The Dump Details are:
    The ABAP/4 Open SQL array insert results in duplicate database records.
    What happened?
    Error in ABAP application program.
    The current ABAP program "SAPLJ1IDEFTAX" had to be terminated because one of
    the
    statements could not be executed.
    This is probably due to an error in the ABAP program.
    What can you do?
    The termination occurred in the ABAP program "SAPLJ1IDEFTAX" in
    "J_1I_POST_DEFTAX_ITEM".
    The main program was "RSM13000 ".
    The termination occurred in line 44 of the source code of the (Include)
    program "LJ1IDEFTAXU04"
    of the source code of program "LJ1IDEFTAXU04" (when calling the editor 440).
    The program "SAPLJ1IDEFTAX" was started in the update system.
    Processing was terminated because the exception "CX_SY_OPEN_SQL_DB" occurred in
    the
    procedure "J_1I_POST_DEFTAX_ITEM" "(FUNCTION)" but was not handled locally, not
    declared in the
    RAISING clause of the procedure.
    The procedure is in the program "SAPLJ1IDEFTAX ". Its source code starts in
    line 7
    of the (Include) program "LJ1IDEFTAX$04 ".
      DATA ls_deftax_item_insert TYPE J_1IDEFTAX_IT.
      LOOP AT it_deftax_item_insert INTO ls_deftax_item_insert.
        IF ls_deftax_item_insert-line_type IS INITIAL.
          message x025(DEFTAX) with sy-tcode
                                           'NO_LINE_TYPE'
                                           'DEFTAX_ITEM'
                                           'FI_POST_DEFTAX_ITEM'.
        ENDIF.
      ENDLOOP.
      IF NOT it_deftax_item_insert[] IS INITIAL.
        INSERT J_1IDEFTAX_IT FROM TABLE it_deftax_item_insert.
      ENDIF.
      IF NOT it_deftax_item_update[] IS INITIAL.
        UPDATE J_1IDEFTAX_IT FROM TABLE it_deftax_item_update.
      ENDIF.
    ENDFUNCTION.
    Is anybody aware of any solution or note related to this.
    Regards,
    Sonali.

    Hi Sonali,
           This error due to Some text objects and messages are missed in consolidation system. Please take help of the basis consultant and implement the support packages 932658 & 932659
    Regards,
    Srinivas Muthyala

Maybe you are looking for