Input data during dynamic vi call

Hi guys. Is it possible to input data during a dynamic VI call?
For eg, i have a car.vi When i call this vi dynamically, i want to also input the value turn left or turn right. How do i acheive this in LV?

hi there
use a invoke node on the VIs reference and call the "Set control value" method to set values of controls during execution of the dynamic VI. Use "Get control value" to retrieve values from indicators.
another possible solution would be the usage of a so called LV2 style global a.k.a. FGV (functional global variable). this needs more drawing but is much more efficient and powerful.
DO NOT use simple global variables.
Best regards
chris
CL(A)Dly bending G-Force with LabVIEW
famous last words: "oh my god, it is full of stars!"

Similar Messages

  • Type conflict during dynamic method call.

    While executing the following program I get the error "Type conflict during dynamic method call.":
    DATA: container_r  TYPE REF TO object,
          grid_r       TYPE REF TO object,
          itab_saplane TYPE TABLE OF saplane.
    * IMPORTANT NOTE: class names must be in UPPER CASE
    DATA: str_cnt TYPE seoclsname VALUE 'CL_GUI_CUSTOM_CONTAINER',
          str_gui TYPE seoclsname VALUE 'CL_GUI_ALV_GRID',
          meth_name TYPE STRING VALUE 'SET_TABLE_FOR_FIRST_DISPLAY'.
    TYPE-POOLS abap.
    DATA: ptab    TYPE abap_parmbind_tab,
          wa_ptab LIKE LINE OF ptab,
          ref     TYPE REF TO data.
    CREATE OBJECT container_r TYPE (str_cnt)
      EXPORTING container_name = 'CUSTOM_CONTROL1'. " Name of the custom control area (UC!)
    * Construct parameter itab
    GET REFERENCE OF container_r INTO ref.
    wa_ptab-name  = 'I_PARENT'.  " Must be upper-case
    wa_ptab-value = ref.
    INSERT wa_ptab INTO TABLE ptab.
    *   EXPORTING i_parent = container_r.
    CREATE OBJECT grid_r TYPE (str_gui)
      PARAMETER-TABLE ptab.
    SELECT * FROM saplane INTO CORRESPONDING FIELDS OF TABLE itab_saplane.
    * Cannot call set_table_for_first_display directly...
    CALL METHOD grid_r->(meth_name)
      EXPORTING I_STRUCTURE_NAME = 'SAPLANE'  " Type of the rows in the internal table  (UC!)
      CHANGING  IT_OUTTAB = itab_saplane.     " The internal table itself
    CALL SCREEN 100.
    Any help would be appreciated!

    Hi ...
    Apologies ... for confusion ... actually both are required ...
    the type 'E' as well as CL_GUI_CONTAINER.
    The below code worked for me ...
    check out how I cast it to the parent class type ...
      DATA : lv_container   TYPE seoclsname VALUE 'CL_GUI_CUSTOM_CONTAINER',
             lv_control     TYPE seoclsname VALUE 'CL_GUI_ALV_GRID',
             lv_method      TYPE string VALUE 'SET_TABLE_FOR_FIRST_DISPLAY',
             lt_par_tab     TYPE abap_parmbind_tab,
             ls_param       LIKE LINE OF lt_par_tab,
             lref_cont      TYPE REF TO cl_gui_container,
             lv_data        TYPE REF TO data.
    CREATE OBJECT lref_container
          TYPE
            (lv_container)
          EXPORTING
            container_name = 'ALV_AREA'.
        ls_param-name = 'I_PARENT'.
        ls_param-kind = 'E'.
        lref_cont ?= lref_container.
        GET REFERENCE OF lref_cont INTO lv_data.
        ls_param-value = lv_data.
        INSERT ls_param INTO TABLE lt_par_tab.
    **  Now create ALV Control.
        CREATE OBJECT lref_alv_ctrl
          TYPE
            (lv_control)
          PARAMETER-TABLE
            lt_par_tab.
    **  Set table for 1st display
        DATA : lv.
        lv = lref_alv_ctrl->mc_fc_print.
        CALL METHOD lref_alv_ctrl->(lv_method)
          EXPORTING
            i_structure_name = 'T001'
          CHANGING
            it_outtab        = lt_company.
    Cheers
    Edited by: Varun Verma on Aug 12, 2008 4:19 PM

  • Input data into dynamic calc in Planning forms

    Hi guys,
    Have someone tried to combine these two requirements:
    1.     to have upper level members dynamic calc
    2.     to give users the ability to input data into those upper level members through Planning forms.
    I need to do that in order to pass inputted values into HBR, and allocate those values to the leaf level across multiple dimensions. I need those members dynamic calc because otherwise I would need to aggregate data across 7 dimensions and that takes too long. Those allocations are suposed to happen constantly and are the main purpose of application.
    I know you can have dummy stored members that correspond the uper level dynamic members, but then the user will have input forms without current data and will be required to check reports/forms with dynamic calc members prior to updating data.
    I wonder if it is a realistic task to change jsp files that generate those forms, so that data can be inputed into the form, but instead of passing it to Essbase cube to send it to relational database.
    P.S.
    This is related to the thread I opened about optimizing recalculation time:
    Recalculatiion takes much longer than initial calculation
    I received a lot of valuable advices that would definitely work in other situations, but in my case they seem to contradict either user concurrent access or performance requirements.
    Thanks a lot!
    Dmitry

    Hi Glenn,
    I think i found a workaround for this, or may be i am missing something. I will replicate my hierarchies so that one hierarchy will have uper level stored members, and another dynamic calc. Once user loads the form it will run on-load script that will copy data from corresponding dynamic calc to stored slice. The updated data will be alocated to the leaf level, but will never be aggregated. Since reporting is done from ASO cube i only care about the leaf level and current selection in the form.
    Thanks!

  • Input Date does not work correctly In dynamic region

    Hello everyone.
    I created a view with a dynamic region. When switch to a region with Input Date components, if I click the "Choose Date" button, this region will exit to default region without any error message.
    The component works well in default region but not in regions switched by Link.
    I tried it in a completely new application and i am sure there is no any problem except the component and the region themselves.
    SO, if someone tied doing this and know what cause it and how to fix it?
    Edited by: 1007000 on 2013-5-20 下午8:49

    Well, i find out the problem. I set the managed bean of the region backing scope, and Input Date is a server-side component. So the taskflow id will lost when i click the Choose Date button.
    change the scope to pageflow, and it works.

  • No data during call??? AT&T?

    Why all of a sudden am I getting the message "no data available during active call"? I thought the not being able to use data while on a call was only with Verizon or Sprint. I have AT&T.

    And if you refuse the data plan, they will refuse service to you. That's how it goes. The use of a smartphone on AT&T's network requires a data plan.

  • No batch input data for screen  occured in Call Transaction method for PA40

    Hi,
    I creatred an interface to update an employee action data ( Change of position )  PA40 by using  Call transaction method.
    while executing the  interface, I got the below error.
    No batch input data for screen MP049100 200 
    this interface updated the first employee from file,  then after it is giving the below error frequently.
    No batch input data for screen MP049100 200
    regards,
    Ashok Reddy Revoori

    The infogroup of action Change Position may be having infotype 0491. The infotypes screen sequence is decided based on employee's country grouping and user group. For the employee where you are receiving error, infotype 0491 screen is appearing for which you do not have BDC data.

  • No batch input data for screen sapmf05A 0700 during BD20

    Hi,
    In BD20, when there are multiple idocs, after the first idoc is succesfully processd, the other idocs fail, as the first one has locked the screen and we get the message No batch input data for screen sapmf05A 0700. Then the other idocs end in error.
    Any pointers to solve this?

    There are no errors...It is because the first idoc has locked the screen, This error is appearing.

  • Creation of error log  on input data  and stat report

    I am doing call transaction on <b>C202</b> transaction.my client asked me before uploading the file he needs some validations on input file and he is asking me to create  a log for all the validations.i have to place error lof for all the input data.
    •An error log will record all errors occurring during upload. For each error the list should
    contain the data (line) going in error and an error text in a subsequent column (subsequent to data). The change number used to perform  the upload will be stated in the header of the error list.A txt-file containing the error log will get the same name as the input file, but with an ending –err.xls.
    Therefore no Batch-Input-Session is needed.
    • After execution of the batch input program, the following analysis regarding execution will be shown:
    o Number of records in input file (including title, first line)
    o Number of records successfully updated
    o Number of records in error
    Example:
    Number of records in input file (incl. first line) 4
    Number of records successfully updated:   3
    Number of records in error:      0
    How to do this according to client  requirements.can u help me to get a statastical way to represent errors.  Send me some smpale code for number of errors and no records gets success and no of failed.
    Thanks
    chandrasekhar

    Hai Chandrasekhar
    Go through the following Code
    report Z_CALLTRANS_VENDOR_01
    no standard page heading line-size 255.
    Generated data section with specific formatting - DO NOT CHANGE ***
    data: begin of it_lfa1 occurs 0,
    KTOKK like lfa1-ktokk,
    NAME1 like lfa1-name1,
    SORTL like lfa1-sortl,
    LAND1 like lfa1-land1,
    end of it_lfa1.
    End generated data section ***
    data : it_bdc like bdcdata occurs 0 with header line.
    *DATA: IT_MESSAGES TYPE TABLE OF BDCMSGCOLL WITH HEADER LINE.
    *DATA: LV_MESSAGE(255).
    data : it_messages like bdcmsgcoll occurs 0 with header line.
    data : V_message(255).
    data : V_flag.
    data : V_datum1 type sy-datum.
    data : begin of it_mesg occurs 0,
    message(100),
    end of it_mesg.
    *V_datum1 = sy-datum-1.
    parameters : P_Sess like APQI-GROUPID.
    start-of-selection.
    perform Get_data.
    *perform open_group.
    loop at it_lfa1.
    perform bdc_dynpro using 'SAPMF02K' '0100'.
    perform bdc_field using 'BDC_CURSOR'
    'RF02K-KTOKK'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'RF02K-KTOKK'
    it_lfa1-KTOKK.
    perform bdc_dynpro using 'SAPMF02K' '0110'.
    perform bdc_field using 'BDC_CURSOR'
    'LFA1-LAND1'.
    perform bdc_field using 'BDC_OKCODE'
    '=UPDA'.
    perform bdc_field using 'LFA1-NAME1'
    it_lfa1-name1.
    perform bdc_field using 'LFA1-SORTL'
    it_lfa1-sortl.
    perform bdc_field using 'LFA1-LAND1'
    it_lfa1-land1.
    call transaction 'XK01' using it_bdc
    mode 'N'
    update 'S'
    messages into it_messages.
    if sy-subrc <> 0.
    if V_flag <> 'X'.
    perform open_group.
    V_flag = 'X'.
    endif.
    perform bdc_transaction. "using 'XK01'.
    endif.
    perform format_messages.
    refresh : it_bdc,it_messages.
    endloop.
    if V_flag = 'X'.
    perform close_group.
    endif.
    *& Form Get_data
    text
    --> p1 text
    <-- p2 text
    FORM Get_data .
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    FILENAME = 'C:\srinu_vendor.txt'
    FILETYPE = 'ASC'
    TABLES
    DATA_TAB = it_lfa1
    EXCEPTIONS
    CONVERSION_ERROR = 1
    INVALID_TABLE_WIDTH = 2
    INVALID_TYPE = 3
    NO_BATCH = 4
    UNKNOWN_ERROR = 5
    GUI_REFUSE_FILETRANSFER = 6
    OTHERS = 7
    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. " Get_data
    *& Form bdc_dynpro
    text
    -->P_0061 text
    -->P_0062 text
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
    CLEAR it_BDC.
    it_BDC-PROGRAM = PROGRAM.
    it_BDC-DYNPRO = DYNPRO.
    it_BDC-DYNBEGIN = 'X'.
    APPEND it_BDC.
    ENDFORM.
    Insert field *
    FORM BDC_FIELD USING FNAM FVAL.
    CLEAR it_BDC.
    it_BDC-FNAM = FNAM.
    it_BDC-FVAL = FVAL.
    APPEND it_BDC.
    ENDFORM.
    *& Form format_messages
    text
    --> p1 text
    <-- p2 text
    FORM format_messages .
    loop at it_messages.
    CALL FUNCTION 'FORMAT_MESSAGE'
    EXPORTING
    ID = it_messages-MSGID
    LANG = 'EN'
    NO = it_messages-MSGNR
    V1 = it_messages-MSGV1
    V2 = it_messages-MSGV2
    V3 = it_messages-MSGV3
    V4 = it_messages-MSGV4
    IMPORTING
    MSG = V_message
    EXCEPTIONS
    NOT_FOUND = 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.
    write : / V_message.
    clear : V_message.
    endloop.
    ENDFORM. " format_messages
    *& Form open_group
    text
    --> p1 text
    <-- p2 text
    FORM open_group .
    CALL FUNCTION 'BDC_OPEN_GROUP'
    EXPORTING
    CLIENT = SY-MANDT
    GROUP = P_Sess
    HOLDDATE = V_datum1
    KEEP = 'X'
    USER = SY-UNAME
    IF SY-SUBRC = 0.
    write : / 'Session Creating wit Name : ',P_Sess.
    ENDIF.
    ENDFORM. " open_group
    *& Form close_group
    text
    --> p1 text
    <-- p2 text
    FORM close_group .
    CALL FUNCTION 'BDC_CLOSE_GROUP'.
    ENDFORM. " close_group
    *& Form bdc_transaction
    text
    -->P_0132 text
    FORM bdc_transaction. "USING VALUE(P_0132).
    CALL FUNCTION 'BDC_INSERT'
    EXPORTING
    TCODE = 'XK01'
    POST_LOCAL = NOVBLOCAL
    PRINTING = NOPRINT
    SIMUBATCH = ' '
    CTUPARAMS = ' '
    TABLES
    DYNPROTAB = it_bdc
    EXCEPTIONS
    INTERNAL_ERROR = 1
    NOT_OPEN = 2
    QUEUE_ERROR = 3
    TCODE_INVALID = 4
    PRINTING_INVALID = 5
    POSTING_INVALID = 6
    OTHERS = 7
    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. " bdc_transaction
    Regards
    Sreeni
    Message was edited by: Sreenivasulu Ponnadi

  • Adobe form not saving user-input data into saved pdf file

    Hi forumers,
    I'm a new abap developer and I'm tasked to create an interactive adobe form that will require the user to input data in the form.
    No data is passed and received from PDF, but PDF has to be u2018Fillableu2019. I am able to fill out the form but when I actually save the form, it will be saved as a blank form again. I've seen the relevance of the  LS_DOCPARAMS-FILLABLE = 'X' on this forum and I have incorporated it in my code. But how should I code the abap program to enable to save the user input as well into the form.
    DATA: GV_FMNAME TYPE FPNAME,
          LS_DOCPARAMS    TYPE SFPDOCPARAMS,
          LS_OUTPUTPARAMS TYPE SFPOUTPUTPARAMS.
    CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
      EXPORTING
        I_NAME                     = 'ZSC_ZRUFORREP'
    IMPORTING
       E_FUNCNAME                  = GV_FMNAME
    *   E_INTERFACE_TYPE           =
    *   EV_FUNCNAME_INBOUND        =
    CALL FUNCTION 'FP_JOB_OPEN'
      CHANGING
        IE_OUTPUTPARAMS       = LS_OUTPUTPARAMS
    EXCEPTIONS
       CANCEL                = 1
       USAGE_ERROR           = 2
       SYSTEM_ERROR          = 3
       INTERNAL_ERROR        = 4
       OTHERS                = 5
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    LS_DOCPARAMS-FILLABLE = 'X'.
    LS_DOCPARAMS-DYNAMIC = 'X'.
    CALL FUNCTION GV_FMNAME
    EXPORTING
       /1BCDWB/DOCPARAMS        = LS_DOCPARAMS
    * IMPORTING
    *   /1BCDWB/FORMOUTPUT       =
    EXCEPTIONS
       USAGE_ERROR              = 1
       SYSTEM_ERROR             = 2
       INTERNAL_ERROR           = 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.
    CALL FUNCTION 'FP_JOB_CLOSE'
    * IMPORTING
    *   E_RESULT             =
    EXCEPTIONS
       USAGE_ERROR          = 1
       SYSTEM_ERROR         = 2
       INTERNAL_ERROR       = 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.
    Thanks,
    dgrachee

    Not quite yet, I have to say...
    If you check the domain "FPINTERACTIVE", you'll see these values:
                   Print Form
    X     Interactive Form with Additional Usage Rights
    N     Interactive Form Without Additional Usage Rights
    F                                                                
    So, you are not providing "additional usage rights" (Adobe Form Credentials), meaning there could be a problem when you want to use those forms in a Production environment.

  • Using importdata to import xml data into dynamic PDF form

    Hi again,
    Me and my colleagues have a problem using the importData service to import some xml data into an empty PDF form (represented as an XFA input variable).
    In the server log I get the error that Only XDP data is supported for XFA forms, however I only have the xml data and not the entire xdp available.
    Is this really not possible to to (like importing xml data to a form is possible in the Designer when creating forms).
    I hope the scenario is understandable
    Sincerely
    Kim Christensen
    Dafolo A/S
    Denmark
    PS: During the various projects I am working on I keep running into problems...however I am totally new to LiveCycle so I consider this very informative learning steps and appreciate all your help :-)

    Hi again,<br /><br />I have been experimenting a little with both the renderPDFForm and importData services. However I don't seem to be ble to make them work as I  need them to.<br /><br />My scenario is simple, I have one (call it a template xdp/PDF form) and lots of data in xml files (around 1000), that I need to import into the template. Therefore I have set up a "Watched Folder" to take the xml as a document (I guess this is a requirement) and then I need either the renderPDF or importData services to import the xml data into the template.<br /><br />I would like to know how I should setup the services to make this work.<br /><br />When I try to use importdata I setup the following:<br /><br />PDF document: set to be the template i need to import the xml to)<br /><br />Input data: the document variable (an xml file) that is passed to the   Watched Folder<br /><br />Data merged PDF: set to an out xfaform<br /><br />When I do this I get an Coercion error in the server log:<br /><br />2007-11-15 13:27:05,324 ERROR [com.adobe.workflow.AWS] stalling action-instance: 1506 with message: ALC-DSC-000-000: com.adobe.idp.dsc.DSCRuntimeException: Internal error.<br />     at com.adobe.idp.dsc.util.CoercionUtil.toDOMDocument(CoercionUtil.java:656)<br />     at com.adobe.idp.dsc.util.CoercionUtil.toType(CoercionUtil.java:878)<br />     at com.adobe.idp.dsc.util.CoercionUtil.toType(CoercionUtil.java:803)<br />     at com.adobe.workflow.datatype.runtime.support.AbstractDataTypeRuntimeHandler.coerceFrom(Abs tractDataTypeRuntimeHandler.java:64)<br />     at com.adobe.workflow.datatype.runtime.support.AbstractComplexDataTypeRuntimeHandler.getNode (AbstractComplexDataTypeRuntimeHandler.java:47)<br />     at com.adobe.workflow.dom.VariableElement.setBoundValue(VariableElement.java:93)<br />     at com.adobe.workflow.pat.service.PATExecutionContextImpl.setProcessDataValue(PATExecutionCo ntextImpl.java:729)<br />     at com.adobe.workflow.pat.service.PATExecutionContextImpl.setProcessDataWithExpression(PATEx ecutionContextImpl.java:335)<br />     at com.adobe.idp.workflow.dsc.service.SetValueService.execute(SetValueService.java:46)<br />...<br />Caused by: ALC-DSC-119-000: com.adobe.idp.dsc.util.InvalidCoercionException: Cannot coerce object: <document state="passive" senderVersion="3" persistent="false" senderPersistent="true" passivated="true" senderPassivated="true" deserialized="true" senderHostId="127.0.0.1/172.16.10.125" callbackId="0" senderCallbackId="7" callbackRef="null" isLocalizable="true" isTransactionBound="false" defaultDisposalTimeout="600" disposalTimeout="600" maxInlineSize="65536" defaultMaxInlineSize="65536" inlineSize="8039" contentType="application/xml" length="-1"><cacheId/><localBackendId/><globalBackendId/><senderLocalBackendId/><senderGl obalBackendId/><inline><?xml version="1.0" encoding="UTF-8"?><br /><form1><br />  <sub_BlanketTop /><br />  <sub_SubjectTop><br />    <f...</inline><senderPullServantJndiName>adobe/idp/DocumentPullServant/adobejb_server1</s enderPullServantJndiName><attributes file="c:\NCRConvert\ProcessForm\stage\Wx450d4b32843a0b0bcb8ef99e\NCR-00564_dXAE3soH.xml"/ ></document> of type: com.adobe.idp.Document to type: interface org.w3c.dom.Document<br />     at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)<br />     at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)<br /><br />However it is possible to manually import the xml data in Acrobat Professional without any problems.<br /><br />When I use the renderPDFForm with the following settings:<br /><br />Form to render: literal value that points to the template<br /><br />Form data: document variable from watched folder (xml)<br /><br />Content Root URI: repository://<br /><br />With these settings I also get a coercion error, however it does not seem to be exactly the same.<br /><br />Sincerely<br />Kim

  • How to get the input data on the arbitrary draw event ?

    Hi all,
    I'm trying to draw a histogram on a arbitrary parameter (just like the "Levels" effect). The draw part is well, but I have a problem with the input layer data (param[0]).
    All I have to do now is read the input data on the arbitrary draw event. But there's not the input pointer on the draw event. So I called the PF_CHECKOUT_PARAM() function to get the input data, and it works!
    When I test in AE, I created a layer A, and added some color correction effects to the layer A before added my effect to the layer A. The problem is the input layer my effect read is not the result of previous effects I applied before.
    Has anyway to read the latest input data in the arbitrary events ?
    Thanks.

    Hi shachar, nice to meet you!
    In another way, I created a sequence data like this:
    typedef struct {
        bool didRender;
        <some histogram data>;
    } Histogram;
    typedef struct {
        Histogram*  histograms;
    } my_sequence_data, *my_sequence_dataP, **my_sequence_dataH;
    my_sequence_data.histograms is an array with in_data->total_time / in_data->time_step items initialized during the sequence setup.
    During the render call, I cached  the calculated histogram at this current_time to the sequence->histograms[in_data->current_time / in_data->time_step], set the didRender = true.
    In this way, I have another problem with the AE cached image. I disabled a random previous effect on the effect panel, then the AE re-rendered my effect, the histogram changed (good). I enabled the effect again, and nothing change (bad )
    I try to force the AE re-rendering after the custom UI changed ( I tried with the event_extraP->evt_out_flags = PF_EO_HANDLED_EVENT; and params[HISTOGRAM_UI]->uu.change_flags |= PF_ChangeFlag_CHANGED_VALUE; on the click, drag events...) but it seem not works!
    Am I on the right way ?
    Thank you so much!

  • No batch input data for screen SAPMSSY0 0120 when running BDC in background

    Hi Experts,
    I am facing an  issue "No batch input data for screen SAPMSSY0 0120" when running a BDC for VA01 in background.
    The scenario is like we have EDI orders coming into SAP in the form Idocs. These EDI orders are processed by Function module
    IDOC_INPUT_ORDERS. This FM module internally calls VA01 (Call Transaction) to create Sales Orders in SAP.
    Now we have a scenario in which we want a popup screen to come up  & ask for selection of record from list of records displayed on popup screen. In background since we can not show up a screen, we are programatically selecting the record we want & going ahead.
    Now what is happening is during foerground the functionality is working abosultely fine, that is incoming idoc is getting posted successfully in SAP with status of 53. Incase of back ground processing of the same we are getting an error
    No batch input data for screen SAPMSSY0 0120
    I have checked this screen through screen painer(SE51) & i did not find any element on this screen but Element list
    shows one field Syst-Xcode.
    Kindly guide me how to fix the issue so that the same can work as expected in background.
    Regards,
    Chetan.

    Hi Chetan,
    List screens utilize SAPMSSY0/0120. Please check within your ABAP coding if you have any customer exit that tries to issue WRITE statements. If so, either remove them or add logic to not issue them in background (e.g. SY-BATCH = 'X'). Another culprit might be a SUBMIT statement in a user exit, which triggers a report with list output. I'm not completely sure, but I think the screen is also used for some value helps (do you have any coding forcing a value help popup?).
    Hope this helps, harald

  • Popualting data into dynamic internal table

    Hi all,
        I am working on Dynamic internal tables.I have created the structure of internal table but i am unable to populate data into it.Though i have seen some of the forums but those didn't help me. please provide me the solution. Here is my code what i did.I have the data in itab and itab1.
      My requirement is meinh fileds are dynamic.thie meinh and umren are two fileds in mvke table.for one record ihave to populate umren value for that particular meinh value.Pls help me.
    mtart     vkorg     werks     mtanr     Meinh(kg)         Meinh(gl)
    fert     0353     0303     3231     Umren value  Umren value
    REPORT  z123.
                  T Y P E - P O O L S
    TYPE-POOLS :slis,abap.
                  T A B L E S
    *Tables
    TABLES: mara,marm,mvke,marc.
                  F I E L D - S Y M B O L S
    FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE,
                    <dyn_wa> ,
                    <dyn_field>.
                    I N T E R N A L         T A B L E S
    Internal Tables declaration for ALV GRID/LIST
    DATA: ls_fieldcat TYPE slis_fieldcat_alv,    "FIELD CATALOG LIST
          tb_uom_cat TYPE slis_t_fieldcat_alv,   "FIELD CATALOG
          ls_fieldcat1 TYPE lvc_s_fcat,
          tb_dy_cat TYPE lvc_t_fcat,             "FIELD CATALOG
          tb_outputcat TYPE slis_t_fieldcat_alv,
          tb_events TYPE slis_t_event,
          ref_grid TYPE REF TO cl_gui_alv_grid,
          t_events LIKE LINE OF tb_events.
    DATA: BEGIN OF itab OCCURS 0,
          mtart LIKE mara-mtart,
          vkorg LIKE mvke-vkorg,
          werks LIKE marc-werks,
          matnr TYPE mara-matnr,
          END OF itab.
    DATA: BEGIN OF itab1 OCCURS 0,
          matnr TYPE marm-matnr,
          umren TYPE marm-umren,
          meinh TYPE marm-meinh,
          END OF itab1.
                            V A R I A B L E S
    Global Variables
    DATA: g_repid   LIKE sy-repid.       "Report ID
    DATA: dy_table TYPE REF TO data,
          dy_line TYPE REF TO data.
                      S E L E C T I O N   S C R E E N
    For User Input(Selection Criteria)
    SELECTION-SCREEN BEGIN OF BLOCK b0 WITH FRAME TITLE text-001.
    SELECT-OPTIONS :
      s_mtart FOR mara-mtart OBLIGATORY,    " Material type
      s_vkorg FOR mvke-vkorg OBLIGATORY,    " Sales Organization
      s_plant FOR marc-werks,               " Plant
      s_meinh FOR marm-meinh.               " Unit of Measure
    SELECTION-SCREEN END OF BLOCK b0.
                         I N I T I A L I Z A T I O N
    INITIALIZATION.
    Program ID
      g_repid = sy-repid.                      " Prog ID
                     A T   S E L E C T I O N -  S C R E E N
    AT SELECTION-SCREEN.
    Validate Material Type
      PERFORM check_mtart.
    Validate Sales Organization
      PERFORM check_vkorg.
    Validate Plant
      PERFORM check_werks.
    Validate Unit of Measure (UOM)
      PERFORM check_meinh.
                      S T A R T - O F  - S E L E C T I O N
    START-OF-SELECTION.
    Get Data
      PERFORM get_data.
    FIELD CATALOG FOR ALV
      PERFORM fill_field_catalog_uom USING tb_uom_cat.
    FIELD CATALOG FOR CREATING DYNAMIC INTERNAL TABLE
      PERFORM fill_field_catalog_dy USING tb_dy_cat.
    CREATING DYNAMIC INTERNAL TABLE
      PERFORM dy_tab_create.
                       End of selection                                  *
                              F O R M S
    *&      Form  CHECK_MTART
          Validate Material Type
    FORM check_mtart .
    Material Type
      DATA :l_mtart LIKE t134-mtart.
      CHECK NOT s_mtart IS INITIAL.
      SELECT mtart UP TO 1 ROWS
        INTO l_mtart
        FROM t134
       WHERE mtart IN s_mtart.
      ENDSELECT.
      IF sy-subrc <> 0.
        MESSAGE e899(mm) WITH 'Invalid Material Type'(002).
      ENDIF.
    ENDFORM.                    " CHECK_MTART
    *&      Form  CHECK_VKORG
          Validate Sales Organization
    FORM check_vkorg .
    Sales Oraganization
      DATA :l_vkorg LIKE tvko-vkorg.
      CHECK NOT s_vkorg IS INITIAL.
      SELECT vkorg UP TO 1 ROWS
        INTO l_vkorg
        FROM tvko
       WHERE vkorg IN s_vkorg.
      ENDSELECT.
      IF sy-subrc <> 0.
        MESSAGE e899(mm) WITH 'Invalid Sales Organization'(003).
      ENDIF.
    ENDFORM.                    " CHECK_VKORG
    *&      Form  CHECK_WERKS
          Validate Plant
    FORM check_werks .
    Plant
      DATA :l_werks LIKE t001w-werks.
      CHECK NOT s_plant IS INITIAL.
      SELECT werks UP TO 1 ROWS
        INTO l_werks
        FROM t001w
       WHERE werks IN s_plant.
      ENDSELECT.
      IF sy-subrc <> 0.
        MESSAGE e899(mm) WITH 'Invalid Plant'(004).
      ENDIF.
    ENDFORM.                    " CHECK_WERKS
    *&      Form  CHECK_MEINH
          Validate Unit of Measure (UOM)
    FORM check_meinh .
    Unit of Measure (UOM)
      DATA :l_meinh LIKE t006-msehi.
      CHECK NOT s_meinh IS INITIAL.
      SELECT msehi UP TO 1 ROWS
        INTO l_meinh
        FROM t006
        WHERE msehi IN s_meinh.
      ENDSELECT.
      IF sy-subrc <> 0.
        MESSAGE e899(mm) WITH 'Invalid Unit of Measure'(005).
      ENDIF.
    ENDFORM.                    " CHECK_MEINH
    *&      Form  FILL_FIELD_CATALOG_UOM
          text
         FIELD CATALOG FOR ALV
    FORM fill_field_catalog_uom  USING l_fieldcat TYPE  slis_t_fieldcat_alv.
      DATA: BEGIN OF l_itab OCCURS 0,
            meinh TYPE marm-meinh,
            END OF l_itab.
    DATA: l_count TYPE i.
      DATA: l_fieldcat_col_pos TYPE i.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname   = 'MTART'.
      ls_fieldcat-key         = ''.
      ls_fieldcat-col_pos     = 1.
      ls_fieldcat-ref_fieldname = 'MTART'.
      ls_fieldcat-ref_tabname   = 'MARA'.
      APPEND ls_fieldcat TO l_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname   = 'VKORG'.
      ls_fieldcat-key         = ''.
      ls_fieldcat-col_pos     = 2.
      ls_fieldcat-ref_fieldname = 'VKORG'.
      ls_fieldcat-ref_tabname   = 'MVKE'.
      APPEND ls_fieldcat TO l_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname   = 'WERKS'.
      ls_fieldcat-key         = ''.
      ls_fieldcat-col_pos     = 3.
      ls_fieldcat-ref_fieldname = 'WERKS'.
      ls_fieldcat-ref_tabname   = 'MARC'.
      APPEND ls_fieldcat TO l_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname   = 'MATNR'.
      ls_fieldcat-key         = 'x'.
      ls_fieldcat-col_pos     = 4.
      ls_fieldcat-ref_fieldname = 'MATNR'.
      ls_fieldcat-ref_tabname   = 'MARA'.
      APPEND ls_fieldcat TO l_fieldcat.
      CLEAR ls_fieldcat.
      l_fieldcat_col_pos = 5.
    Getting the UOM as per user selection
      SELECT  msehi  FROM t006
        INTO TABLE l_itab
        WHERE msehi IN s_meinh.
      LOOP AT l_itab.
        ls_fieldcat-fieldname   = l_itab-meinh.
        ls_fieldcat-key         = ''.
        ls_fieldcat-col_pos     = l_fieldcat_col_pos.
        ls_fieldcat-ref_fieldname = 'MSEHI'.
        ls_fieldcat-ref_tabname   = 'T006'.
        APPEND ls_fieldcat TO l_fieldcat.
        CLEAR ls_fieldcat.
        l_fieldcat_col_pos = l_fieldcat_col_pos + 1.
      ENDLOOP.
    ENDFORM.                    " FILL_FIELD_CATALOG_UOM
    *&      Form  DISPLAY_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM display_data .
    ENDFORM.                    " DISPLAY_DATAENDFORM.                    " FILL_FIELD_CATALOG_UOM
    *&      Form  DY_TAB_CREATE
          text
    -->  p1        text
    <--  p2        text
    FORM dy_tab_create .
    CREATE DYNAMIC INTERNAL TABLE AND ASSIGN TO FS
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = tb_dy_cat
        IMPORTING
          ep_table        = dy_table.
      ASSIGN dy_table->* TO <dyn_table>.
    *CREATE DYNAMIC WORK AREA AND AASIGN TO FS
      CREATE DATA dy_line LIKE LINE OF  <dyn_table>.
      ASSIGN dy_line->* TO <dyn_wa>.
    ENDFORM.                    " DY_TAB_CREATE
    *&      Form  FILL_FIELD_CATALOG_DY
          text
        FIELD CATALOG FOR CREATING A DYNAMIC TABLE
    FORM fill_field_catalog_dy  USING  l_fieldcat TYPE lvc_t_fcat.
      DATA: BEGIN OF l_itab OCCURS 0,
           meinh TYPE marm-meinh,
           END OF l_itab.
      DATA: l_count TYPE i.
      DATA: l_fieldcat_col_pos TYPE i.
      DATA: l_umren TYPE string.
      DATA: l_var TYPE string.
      CLEAR ls_fieldcat.
      ls_fieldcat1-fieldname   = 'MTART'.
      ls_fieldcat1-key         = ''.
      ls_fieldcat1-col_pos     = 1.
      ls_fieldcat1-datatype = 'char'.
      ls_fieldcat1-intlen = 4.
      APPEND ls_fieldcat1 TO l_fieldcat.
      CLEAR ls_fieldcat1.
      ls_fieldcat1-fieldname   = 'VKORG'.
      ls_fieldcat1-key         = ''.
      ls_fieldcat1-col_pos     = 2.
      ls_fieldcat1-datatype = 'char'.
      ls_fieldcat1-intlen = 4.
      APPEND ls_fieldcat1 TO l_fieldcat.
      CLEAR ls_fieldcat1.
      ls_fieldcat1-fieldname   = 'WERKS'.
      ls_fieldcat1-key         = ''.
      ls_fieldcat1-col_pos     = 3.
      ls_fieldcat1-datatype = 'char'.
      ls_fieldcat1-intlen = 4.
      APPEND ls_fieldcat1 TO l_fieldcat.
      CLEAR ls_fieldcat1.
      ls_fieldcat1-fieldname   = 'MATNR'.
      ls_fieldcat1-key         = 'x'.
      ls_fieldcat1-col_pos     = 4.
      ls_fieldcat1-datatype = 'char'.
      ls_fieldcat1-intlen = 18.
      APPEND ls_fieldcat1 TO l_fieldcat.
      CLEAR ls_fieldcat1.
      l_fieldcat_col_pos = 5.
    Getting the UOM as per user selection
      SELECT  msehi  FROM t006
        INTO TABLE l_itab
        WHERE msehi IN s_meinh.
      SORT l_itab ASCENDING.
      DESCRIBE TABLE l_itab LINES l_count.
      LOOP AT l_itab.
        ls_fieldcat1-fieldname   = l_itab-meinh.
        ls_fieldcat1-key         = ''.
        ls_fieldcat1-col_pos     = l_fieldcat_col_pos.
        ls_fieldcat1-datatype = 'dec'.
        ls_fieldcat1-intlen = 5.
        APPEND ls_fieldcat1 TO l_fieldcat.
        CLEAR ls_fieldcat1.
        l_fieldcat_col_pos = l_fieldcat_col_pos + 1.
      ENDLOOP.
    ENDFORM.                    " FILL_FIELD_CATALOG_DY
    *&      Form  GET_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM get_data .
      SELECT
      amtart bvkorg cwerks amatnr
      INTO TABLE itab
      FROM mara AS a
      JOIN mvke AS b ON  bmatnr = amatnr
      JOIN marc AS c ON  cmatnr = bmatnr
      JOIN marm AS d ON  dmatnr = cmatnr
      WHERE a~mtart IN s_mtart
       AND  b~vkorg IN s_vkorg
       AND  c~werks IN s_plant.
      SORT itab ASCENDING.
      DELETE ADJACENT DUPLICATES FROM itab.
      SELECT matnr umren meinh FROM marm
      APPENDING TABLE itab1
      FOR ALL ENTRIES IN itab
      WHERE matnr = itab-matnr
      AND meinh IN s_meinh .
    ENDFORM.                    " GET_DATA

    can you check this for creation of dynamic table
    ******DATA DECLARATION*****************************
    FIELD-SYMBOLS : <it_final> TYPE STANDARD TABLE,
                    <wa_final> TYPE ANY,
                    <w_field> TYPE ANY.
    ***DYNAMIC CREATION OF FIELDCATALOG****************
    *FIRST 2 FIELDS FIELDS FIELD1 AND FIELD2 ARE CONSTANT, FIELDS OBTAINED IN THE LOOP ENDLOOP ARE DYNAMIC,
    *LIKEWISE DYNAMIC FIELDCATALOG IS CREATED
      wa_fieldcatalog-fieldname  = 'FIELD1'.
      wa_fieldcatalog-ref_table  = 'E070'.
      wa_fieldcatalog-outputlen  = '13'.
      wa_fieldcatalog-reptext    = 'Created On'.
      wa_fieldcatalog-seltext    = 'Created On'.
      APPEND wa_fieldcatalog TO it_fieldcatalog.
      CLEAR wa_fieldcatalog.
      wa_fieldcatalog-fieldname  = 'FIELD1'.
      wa_fieldcatalog-ref_table  = 'E070'.
      wa_fieldcatalog-outputlen  = '13'.
      wa_fieldcatalog-reptext    = 'Created On'.
      wa_fieldcatalog-seltext    = 'Created On'.
      APPEND wa_fieldcatalog TO it_fieldcatalog.
      CLEAR wa_fieldcatalog.
      LOOP AT it_mandt WHERE mandt IN s_mandt.
        CONCATENATE 'CLNT' it_mandt INTO wa_fieldcatalog-fieldname.
        wa_fieldcatalog-inttype    = 'NUMC'.
        wa_fieldcatalog-outputlen  = '14'.
        wa_fieldcatalog-reptext    = it_mandt.
        wa_fieldcatalog-seltext    = it_mandt.
        APPEND wa_fieldcatalog TO it_fieldcatalog.
        CLEAR :wa_fieldcatalog ,it_mandt.
      ENDLOOP.
    ********CREATE DYNAMIC TABLE************************
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog           = it_fieldcatalog
        IMPORTING
          ep_table                  = new_table
        EXCEPTIONS
          generate_subpool_dir_full = 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.
      ASSIGN new_table->* TO <it_final>.
    *********CREATE WORK AREA****************************
    CREATE DATA new_line LIKE LINE OF <it_final>.
      ASSIGN new_line->* TO <wa_final>.
    *********INSERTTING WORK AREAR TO INTERNAL TABLE******
        INSERT <wa_final> INTO TABLE <it_final>.
    *******POPULATING DATA******************************* 
      LOOP.
       ASSIGN COMPONENT 'FIELD1' OF STRUCTURE <wa_final> TO <w_field>.
       <w_field> = '12345'.
        ASSIGN COMPONENT 'FIELD2' OF STRUCTURE <wa_final> TO <w_field>.
       <w_field> = '21453DD'.
       FIELD1 AND FIELD2 ARE COMPONENTS OF FIELDCATALOG.
    ENDLOOP.     
      ENDLOOP.

  • Update of BP General Data during creation of BP

    Hi,
    I am currently using BADI ADDRESS_CHECK to perform an external check in a 3rd party application using XI to check if the customer name/address is flagged as a "denied party".
    This works fine and returns the correct response if the check finds a denied party.
    However, if this is the case ie. a denied party I want this to set some BP data accordingly during the same BP maintenance.
    The data I need to set is as follows:
    1. BP central block (general data)
    2. BP status needs to be set
    I have located function module BUP_MEMORY_BUT000_FILL that I am calling with a BP structure with the necessary block set to 'X' but it does not seem to do anything.
    Can anyone provide details on how to call this function module to set BP general data during a create or a change of a BP as I must be missing something.
    Also, can anyone tell me what the equivalent function module is for BP status data ?
    Any help is greatly appreciated.
    Cheers
    Colin.

    HI
    You cud use the following BAPI's for BP general data
    BUPA_CENTRAL_CHANGE
    Have a look at the function group:BUBA_4 in package :BUPA
    For status you could use the following
    CRM_BUPA_FRG0050_CHANGE
    CRM_BUPA_FRG0050_Create
    CRM_BUPA_FRG0050_GET_DETAIL
    CRM_BUPA_FRG0050_SAVE_COMMIT
    Regards
    Jay.

  • How to populate data in dynamic internal table

    Hi Expert,
    fyi. My dynamic internal table field is created base on data selected. Eg. select table qpcd has 5 records.  These 5 recods will become fieldname to my dynamic internal table. My dynamic internal table will be
    ...itab
          01
          02
          03
          04
          05
    The 5 records from qpcd is populated in another table call viqmel.  I need to find the occurance of each code in viqmel and populate the number of occurance in itab in each of column.  The final dynamic itab will be like this
    table itab
    01       02     03    04     05   -
    > field name
    2         0        1     0       1    -
    > data
    my source code like below
    Report ZPLYGRND2.
    TABLES: mara, makt.
    TYPE-POOLS: slis, sydes.
    DATA:it_fcat TYPE slis_t_fieldcat_alv,
         is_fcat LIKE LINE OF it_fcat,
         ls_layout TYPE slis_layout_alv.
    DATA: it_fieldcat TYPE lvc_t_fcat,
          is_fieldcat LIKE LINE OF it_fieldcat.
    DATA: new_table TYPE REF TO data,
          new_line TYPE REF TO data,
          ob_cont_alv TYPE REF TO cl_gui_custom_container,
          ob_alv TYPE REF TO cl_gui_alv_grid,
          vg_campos(255) TYPE c,
          i_campos LIKE TABLE OF vg_campos,
          vg_campo(30) TYPE c,
          vg_tables(60) TYPE c.
    types : begin of t_qpcd,
             codegruppe like qpcd-codegruppe,
             code like qpcd-code,
            end of t_qpcd.
    data:wa_qpcd type t_qpcd,
         i_qpcd type standard table of t_qpcd initial size 0.
    FIELD-SYMBOLS: <l_table> TYPE table,
                   <l_line> TYPE ANY,
                   <l_field> TYPE ANY.
    select * into corresponding fields of wa_qpcd from qpcd
    where katalogart = 'D'
    and   codegruppe = 'OOT01'.
    append wa_qpcd to i_qpcd.
    endselect.
    loop at i_qpcd into wa_qpcd.
      is_fcat-fieldname = wa_qpcd-code.
      APPEND is_fcat TO it_fcat.
    endloop.
    LOOP AT it_fcat INTO is_fcat.
        is_fieldcat-fieldname = is_fcat-fieldname.
        is_fieldcat-ref_field = is_fcat-ref_fieldname.
        is_fieldcat-ref_table = is_fcat-ref_tabname.
        APPEND is_fieldcat TO it_fieldcat.
    ENDLOOP.
    *... Create the dynamic internal table
    CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
            it_fieldcatalog = it_fieldcat
        IMPORTING
            ep_table = new_table.
    if sy-subrc = 0.
    endif.
    *... Create a new line
    ASSIGN new_table->* TO <l_table>.
    CREATE DATA new_line LIKE LINE OF <l_table>.
    ASSIGN new_line->* TO <l_line>.
    LOOP AT <l_table> INTO <l_line>.
    ENDLOOP.

    hello dear i m giving u a code in this a dynamic table is made on the basis of table in database , and u can download this data correct it , see it, or even change it....and upload in tht table help full if u dont know the table name...in advance.
    also the code to populate data in dynamic table is in this code like:
    SELECT * FROM (MTABLE_N)
    INTO CORRESPONDING FIELDS OF TABLE <FS_ITAB> .
    look at the whole program .hope this solve ur problem thanks.
    REPORT ZTESTA  MESSAGE-ID ZIMM    .
    TYPES : DATA_OBJECT TYPE REF TO DATA.
    DATA : MITAB TYPE REF TO DATA .
    TYPE-POOLS : SLIS .
    DATA : IT_FIELDCAT TYPE STANDARD TABLE OF SLIS_FIELDCAT_ALV
    WITH HEADER LINE .
    DATA : IT_FIELDCATALOG TYPE LVC_T_FCAT .
    DATA : WA_FIELDCATALOG TYPE LVC_S_FCAT .
    DATA : I_STRUCTURE_NAME LIKE DD02L-TABNAME .
    DATA : I_CALLBACK_PROGRAM LIKE SY-REPID .
    DATA : DYN_LINE TYPE DATA_OBJECT .
    FIELD-SYMBOLS : <FS_ITAB> TYPE STANDARD TABLE .
    DATA : TABLE_NAME_IS_VALID TYPE C .
    DATA : DYNAMIC_IT_INSTANTIATED TYPE C .
    CONSTANTS BUTTONSELECTED TYPE C VALUE 'X' .
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 5(29) T_TABL.
    PARAMETERS : MTABLE_N LIKE RSRD1-TBMA_VAL
    MATCHCODE OBJECT DD_DBTB_16 OBLIGATORY .
    DATA CHECKTABLED.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 5(29) T_FILE.
    PARAMETERS : MFILENAM LIKE RLGRAP-FILENAME .
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 5(29) T_DOWN.
    PARAMETERS : P_DOWNLD RADIOBUTTON GROUP GRP1
    USER-COMMAND M_UCOMM .
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 5(29) T_CHKF.
    PARAMETERS : P_CHKFIL RADIOBUTTON GROUP GRP1 .
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 5(29) T_UPLD.
    PARAMETERS : P_UPLOAD RADIOBUTTON GROUP GRP1 .
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 5(29) T_SHOW.
    PARAMETERS : P_SHOW_T RADIOBUTTON GROUP GRP1 .
    SELECTION-SCREEN END OF LINE.
    AT SELECTION-SCREEN OUTPUT .
      PERFORM CHECK_FILENAME .
    AT SELECTION-SCREEN.
      IF SY-UCOMM = 'ONLI'.
        CHECKTABLED = MTABLE_N+0(1).
        IF CHECKTABLED NE 'Z'.
          MESSAGE I017.
          LEAVE TO SCREEN 1000.
        ENDIF.
        IF SY-UNAME NE 'KAMESH.K'.
          MESSAGE I023 WITH SY-UNAME.
          LEAVE TO SCREEN 1000.
        ENDIF.
      ENDIF.
      IF SY-UCOMM = 'PRIN'.
        CHECKTABLED = MTABLE_N+0(1).
        IF CHECKTABLED NE 'Z'.
          MESSAGE I017.
          LEAVE TO SCREEN 1000.
        ENDIF.
        IF SY-UNAME NE 'KAMESH.K'.
          MESSAGE I023 WITH SY-UNAME.
          LEAVE TO SCREEN 1000.
        ENDIF.
      ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR MFILENAM .
      PERFORM F4_FOR_FILENAME .
    INITIALIZATION .
      T_TABL = 'Table Name' .
      T_FILE = 'File Name' .
      T_DOWN = 'Download Table' .
      T_CHKF = 'Check File to Upload' .
      T_UPLD = 'Upload File' .
      T_SHOW = 'Show Table Contents' .
    START-OF-SELECTION .
      PERFORM CHECK_TABLE_NAME_IS_VALID .
    END-OF-SELECTION .
      IF TABLE_NAME_IS_VALID EQ ' ' .
        MESSAGE I398(00) WITH 'INVALID TABLE NAME' .
      ELSE .
        PERFORM INSTANTIATE_DYNAMIC_INTERNAL_T .
        CHECK DYNAMIC_IT_INSTANTIATED = 'X' .
        CASE BUTTONSELECTED .
          WHEN P_DOWNLD .
            PERFORM SELECT_AND_DOWNLOAD .
          WHEN P_CHKFIL .
            PERFORM CHECK_FILE_TO_UPLOAD .
          WHEN P_UPLOAD .
            PERFORM UPLOAD_FROM_FILE .
          WHEN P_SHOW_T .
            PERFORM SHOW_CONTENTS .
        ENDCASE .
      ENDIF .
    FORM CHECK_TABLE_NAME_IS_VALID.
      DATA MCOUNT TYPE I .
      TABLES DD02L .
      CLEAR TABLE_NAME_IS_VALID .
      SELECT COUNT(*) INTO MCOUNT FROM TADIR
      WHERE PGMID = 'R3TR'
      AND OBJECT = 'TABL'
      AND OBJ_NAME = MTABLE_N .
      IF MCOUNT EQ 1 .
        CLEAR DD02L .
        SELECT SINGLE * FROM DD02L WHERE TABNAME = MTABLE_N .
        IF SY-SUBRC EQ 0.
          IF DD02L-TABCLASS = 'TRANSP' .
            TABLE_NAME_IS_VALID = 'X' .
          ENDIF .
        ENDIF.
      ENDIF .
    ENDFORM. " CHECK_TABLE_NAME_IS_VALID
    FORM SELECT_AND_DOWNLOAD.
      CLEAR : <FS_ITAB> .
      SELECT * FROM (MTABLE_N)
      INTO CORRESPONDING FIELDS OF TABLE <FS_ITAB> .
      PERFORM CHECK_FILENAME.
      CALL FUNCTION 'WS_DOWNLOAD'
           EXPORTING
                FILENAME                = MFILENAM
                FILETYPE                = 'DAT'
           TABLES
                DATA_TAB                = <FS_ITAB>
           EXCEPTIONS
                FILE_OPEN_ERROR         = 1
                FILE_WRITE_ERROR        = 2
                INVALID_FILESIZE        = 3
                INVALID_TYPE            = 4
                NO_BATCH                = 5
                UNKNOWN_ERROR           = 6
                INVALID_TABLE_WIDTH     = 7
                GUI_REFUSE_FILETRANSFER = 8
                CUSTOMER_ERROR          = 9
                OTHERS                  = 10.
      IF SY-SUBRC EQ 0.
        MESSAGE I398(00) WITH 'Table' MTABLE_N
        'successfully downloaded to '
        MFILENAM .
      ENDIF.
    ENDFORM. " SELECT_AND_DOWNLOAD
    FORM UPLOAD_FROM_FILE.
      DATA : ANS TYPE C .
      DATA : LINES_OF_ITAB TYPE I .
      DATA : MSY_SUBRC TYPE I .
      CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
           EXPORTING
                TEXTLINE1 = 'Are you sure you wish to upload'
                TEXTLINE2 = 'data from ASCII File to DB table '
                TITEL     = 'Confirmation of Data Upload'
           IMPORTING
                ANSWER    = ANS.
      IF ANS = 'J' .
        PERFORM CHECK_FILENAME.
        CLEAR MSY_SUBRC .
        CALL FUNCTION 'WS_UPLOAD'
             EXPORTING
                  FILENAME                = MFILENAM
                  FILETYPE                = 'DAT'
             TABLES
                  DATA_TAB                = <FS_ITAB>
             EXCEPTIONS
                  CONVERSION_ERROR        = 1
                  FILE_OPEN_ERROR         = 2
                  FILE_READ_ERROR         = 3
                  INVALID_TYPE            = 4
                  NO_BATCH                = 5
                  UNKNOWN_ERROR           = 6
                  INVALID_TABLE_WIDTH     = 7
                  GUI_REFUSE_FILETRANSFER = 8
                  CUSTOMER_ERROR          = 9
                  OTHERS                  = 10.
        MSY_SUBRC = MSY_SUBRC + SY-SUBRC .
        IF SY-SUBRC EQ 0.
          DESCRIBE TABLE <FS_ITAB> LINES LINES_OF_ITAB .
          IF LINES_OF_ITAB GT 0 .
            MODIFY (MTABLE_N) FROM TABLE <FS_ITAB> .
            MSY_SUBRC = MSY_SUBRC + SY-SUBRC .
          ENDIF .
        ENDIF.
        IF MSY_SUBRC EQ 0 .
          MESSAGE I398(00) WITH LINES_OF_ITAB
          'Record(s) inserted in table'
          MTABLE_N .
        ELSE .
          MESSAGE I398(00) WITH
          'Errors occurred No Records inserted in table'
          MTABLE_N .
        ENDIF .
      ENDIF .
    ENDFORM. " UPLOAD_FROM_FILE
    FORM F4_FOR_FILENAME.
      CALL FUNCTION 'WS_FILENAME_GET'
           EXPORTING
                DEF_PATH         = 'C:\'
                MASK             = ',.,..'
                MODE             = '0'
           IMPORTING
                FILENAME         = MFILENAM
           EXCEPTIONS
                INV_WINSYS       = 1
                NO_BATCH         = 2
                SELECTION_CANCEL = 3
                SELECTION_ERROR  = 4
                OTHERS           = 5.
    ENDFORM. " F4_FOR_FILENAME
    FORM CHECK_FILENAME.
      IF MFILENAM IS INITIAL
      AND NOT ( MTABLE_N IS INITIAL )
      AND P_SHOW_T NE BUTTONSELECTED.
        CONCATENATE 'C:\'
        MTABLE_N '.TXT' INTO MFILENAM.
      ENDIF .
    ENDFORM. " CHECK_FILENAME
    FORM INSTANTIATE_DYNAMIC_INTERNAL_T.
      CLEAR DYNAMIC_IT_INSTANTIATED .
      I_STRUCTURE_NAME = MTABLE_N .
      CLEAR IT_FIELDCAT[] .
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
           EXPORTING
                I_STRUCTURE_NAME       = I_STRUCTURE_NAME
           CHANGING
                CT_FIELDCAT            = IT_FIELDCAT[]
           EXCEPTIONS
                INCONSISTENT_INTERFACE = 1
                PROGRAM_ERROR          = 2
                OTHERS                 = 3.
      IF SY-SUBRC EQ 0.
        LOOP AT IT_FIELDCAT .
          CLEAR WA_FIELDCATALOG .
          MOVE-CORRESPONDING IT_FIELDCAT TO WA_FIELDCATALOG .
          WA_FIELDCATALOG-REF_FIELD = IT_FIELDCAT-FIELDNAME .
          WA_FIELDCATALOG-REF_TABLE = MTABLE_N .
          APPEND WA_FIELDCATALOG TO IT_FIELDCATALOG .
        ENDLOOP .
        CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
        EXPORTING
        IT_FIELDCATALOG = IT_FIELDCATALOG
        IMPORTING
        EP_TABLE = MITAB .
        ASSIGN MITAB->* TO <FS_ITAB> .
        DYNAMIC_IT_INSTANTIATED = 'X' .
      ENDIF.
    ENDFORM. " INSTANTIATE_DYNAMIC_INTERNAL_T
    FORM SHOW_CONTENTS.
      CLEAR : <FS_ITAB> .
      SELECT * FROM (MTABLE_N)
      INTO CORRESPONDING FIELDS OF TABLE <FS_ITAB> .
      I_CALLBACK_PROGRAM = SY-REPID .
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
           EXPORTING
                I_CALLBACK_PROGRAM = I_CALLBACK_PROGRAM
                IT_FIELDCAT        = IT_FIELDCAT[]
           TABLES
                T_OUTTAB           = <FS_ITAB>
           EXCEPTIONS
                PROGRAM_ERROR      = 1
                OTHERS             = 2.
    ENDFORM. " SHOW_CONTENTS
    FORM CHECK_FILE_TO_UPLOAD.
      PERFORM CHECK_FILENAME.
      CALL FUNCTION 'WS_UPLOAD'
           EXPORTING
                FILENAME                = MFILENAM
                FILETYPE                = 'DAT'
           TABLES
                DATA_TAB                = <FS_ITAB>
           EXCEPTIONS
                CONVERSION_ERROR        = 1
                FILE_OPEN_ERROR         = 2
                FILE_READ_ERROR         = 3
                INVALID_TYPE            = 4
                NO_BATCH                = 5
                UNKNOWN_ERROR           = 6
                INVALID_TABLE_WIDTH     = 7
                GUI_REFUSE_FILETRANSFER = 8
                CUSTOMER_ERROR          = 9
                OTHERS                  = 10.
      IF SY-SUBRC EQ 0.
        I_CALLBACK_PROGRAM = SY-REPID .
        CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
             EXPORTING
                  I_CALLBACK_PROGRAM = I_CALLBACK_PROGRAM
                  IT_FIELDCAT        = IT_FIELDCAT[]
             TABLES
                  T_OUTTAB           = <FS_ITAB>
             EXCEPTIONS
                  PROGRAM_ERROR      = 1
                  OTHERS             = 2.
      ENDIF .
    ENDFORM. " CHECK_FILE_TO_UPLOAD
    Message was edited by:
            SAURABH SINGH
            SENIOR EXECUTIVE
            SAMSUNG INDIA ELECTRONICS LTD.,NOIDA

Maybe you are looking for

  • OIM 9.1.0.2: Remove user assigned to a task in Provisioning Process

    I have read Note: Ability to Have Multiple Approvers Per Resource Object in OIM [ID 429999.1], and executed each steps described in it. But when grant these resource object to some user. First the request was not sended directly to a approval process

  • How to avoid the user selecting a different path in my installer

    Hello again all you helpful forum-goers! I have an application and a corresponding installer, and then I have a separate installer putting some support files in the same directory.  My problem is that if the user selects a different path to which to

  • Uploading data

    Hi sap gurus, 1) What r the datas we  have to upload before golive 2) How can i divided to upload data, like open items, cleard items $ balances like this thanku raj

  • Help in me21n

    HI guru, I need to create a custom control in me21n. my control is: when I add a purchase order into position table, check if the PO that I am entering is already present in the list of items. u know any exit or enhancements to do that? thanks in adv

  • Update Other SLDs

    Hi, I have two NW 7.11 system. I want to transport technical and business system definitions from SLD to another's SLD. I have added the URL, username and password in Administration ->  data supplier/Update Other SLDs but it wasnt updated. What could