Multiple where lexcial parameters (how can i handle this situation?)

hi, I am new to reports can someone help me to solve my problem how can i use multiple lexical parameters for WHERE clause, i am using sample OE (Order Entry) schema
User Parameters
EID_FROM
EID_TO
EID_WHERE_CLAUSE
SAL_FROM
SAL_TO
SAL_WHERE_CLAUSE
QUERY
select EMPLOYEE_ID,FIRST_NAME,LAST_NAME,HIRE_DATE,SALARY,MANAGER_ID,DEPARTMENT_ID
from employees
&EID_WHERE_CLAUSE &Sal_where_clause
AFTER PARAMETER FROM
function AfterPForm return boolean is
begin
if :EID_FROM is NULL or :EID_TO is NULL
     then :EID_WHERE_CLAUSE := 'WHERE 1=1';
ELSE
     :EID_WHERE_CLAUSE := 'WHERE EMPLOYEE_ID BETWEEN '||:EID_FROM||' AND '||:EID_TO;
END IF;     
if :SAL_FROM is Null or :sal_to is Null
     then :SAL_WHERE_CLAUSE := 'WHERE 1=1';
ELSE
     :SAL_WHERE_CLAUSE :='AND SALARY BETWEEN '||:SAL_FROM||' AND '||:SAL_TO;
     END IF;
return (TRUE);
end;

Thank you sir, it really helped me to solve my problem, now it looks like this and working fine, i hope now there is no logical error in my code, please suggest.
i am really surprised by such a rapid response, i hope i will learn soon from GURUZz
PARAMETERS_
EID_FROM
EID_TO
H_DATE_FROM
H_DATE_TO
SAL_FROM
SAL_TO
L_CLAUSE
QUERY_
select e.employee_id, e.first_name, e.hire_date, j.job_title, d.department_name, e.salary
from employees e, jobs j, departments d
where e.job_id = j.job_id
and e.department_id = d.department_id
&L_CLAUSE
order by e.employee_id
AFTERPARAMETERFORM_
function AfterPForm return boolean is
begin
IF :EID_FROM is NULL or :EID_TO is NULL
     THEN NULL;
ELSE
     :L_CLAUSE := 'AND EMPLOYEE_ID BETWEEN :EID_FROM AND :EID_TO';
END IF;
IF :SAL_FROM is NULL OR :SAL_TO IS NULL
     THEN NULL;
ELSE
     :L_CLAUSE := :L_CLAUSE||' AND SALARY BETWEEN :SAL_FROM AND :SAL_TO';
END IF;
IF :H_DATE_FROM is NULL OR :H_DATE_TO IS NULL
     THEN NULL;
ELSE
:L_CLAUSE := :L_CLAUSE||' AND HIRE_DATE BETWEEN ' || '''' || :H_DATE_FROM || '''' || ' and ' ||'''' || :H_DATE_TO || '''';
END IF;
return (TRUE);
end;
Edited by: M. Khurram Khurshid on Jan 4, 2012 8:44 PM

Similar Messages

  • I want to rent an unit For Items How Can I Handle This cycle ??

    i want to rent an unit For Items How Can I Handle This Cycle ??

    If you type :
    <p>some text here <img src="some_image.jpg">and more text here</p>
    then it will be displayed as in :
    some text here
    <some_image.jpg>
    and more text here
    It splits all the sentence !.. no need to give you an URL example... it's logic ! please try...

  • I Have iTunes since 2008. I have changed computers and I know have old libraries but iTunes do not locate a lot of songs when I try to play it. How can I correct this situation?

    I Have iTunes since 2008. I have changed computers and I know have old libraries in my Hard Disk but iTunes do not locate a lot of songs when I try to play it. How can I correct this situation?

    When iTunes say that try to find the file you want iTunes to play in your iTunes > Media folder.  If iTunes offers to find others, let it. If it does not find them all you will have to find them yourself or re-add the files from your drive to iTunes (use Automatically Add to iTunes folder).
    iTunes 9: Understanding the "Automatically Add to iTunes" folder. - http://support.apple.com/kb/HT3832 - Files put into this folder are actually moved from this folder onto the correct location in the iTunes Media folder.

  • I bought this program, but it was downloaded on japanese language. How can I correct this situation? I need an english

    I bought this program, but it was downloaded on japanese language. How can I correct this situation? I need an english

    Apple apps are multi-lingual.
    Motion uses the language your System is set for in the Systems Prefs.
    A manual selection of each app's interface language is optional with this free tool:
    http://www.tj-hd.co.uk/en-gb/languageswitcher/

  • At variance with Firefox 3, Firefox 4 does not ask me to save the opened tabs when I quit on having multiple opened tabs. How can I do this in Firefox 4?

    In Firefox 3, when I happened to close the program on having multiple opened tabs, Firefox asked me if I wanted to save and remember the opened tabs, so that I could retrieve them at the next Firefox restart. Firefox 4 does not do this anymore. Is it because I have not configured it correctly somehow, or is this normal? How can I recover this function?
    Thanks in advance,
    Andrea

    One change in Firefox 4 is to by default stop Firefox displaying the warning message, but it can be turned back on by changing some preferences.
    # Type '''about:config''' into the location bar and press enter
    # Accept the warning message that appears, you will be taken to a list of preferences
    # Locate the preference '''browser.tabs.warnOnClose''', if its value is set to '''false''', double-click on it to change its value to '''true'''
    # Repeat this for these 3 preferences '''browser.warnOnQuit''', '''browser.warnOnRestart''' and '''browser.showQuitWarning'''

  • I don't have a user acount password but need to delete it. How can I handle this?

    I don't have a user acount password but need to delete it.
    How can I do this?

    You can't delete something that does not exist.

  • In my library of photos I have 1128 pics, but when I try to syncronize my iPod with these photos only I can save almost the half of pictures, How can I resolve this situation

    In my libray of photos I have 1128 pics, but when I try to syncronize my iPod, only can I copy the half of them, How can I resolve this situation

    See:
    iTunes: Unable to sync photos
    If yo are using the folder syncing method do you have all the photos in one folder?
    Is there anything different about the photos that do sync and those that do not?

  • I have 10.6.8 with Safari 5.1.10 and am getting a "blocked plug-in" error message, how can I rectify this situation?

    I have OS X 10.6.8 with Safari 5.1.10 and am getting a "blocked plug-in" error message. I have already gone into the Safari/preferences/securtiy and the allow all plug-ins has been checked. What can I do to rectify this situation?

    Niel, I clicked on the message and tried to download an updated flash player but it would not let me do it! The same error message - blocked plu-in - came up again when I went to step 3 in the download process. My iMac ia an older model 4,1 with power PC could this be causing the problem?

  • One 40GB Project burned on Multiple DVD's? How can i do this

    I have a really big file (roughly 3.5 hours of dv footage) and I am trying to figure out how to get the project to burn successfully onto multiple DVD's. iDVD usually just automates this functionality for me so I am a little confused on how to do this.
    Im guessing it has something to do with Build and Formatting?
    Thanks.

    Ok, first off if you bring DV footage into iDVD or DVD SP it will be compressed to MPEG-2 video (because that is what video DVDs use). The good news is that with DVD SP you can fit 3.5 hours of video onto one Dual Layer disc. The bad news is now all footage has been compressed, so if you want to take that footage and go back and edit there will be a guaranteed, noticeable loss in quality.
    If you want to keep your DV footage as DV footage then I recommend buying Toast. It can create Data discs that can be read by Macs or PCs, and it will automatically divide up/segment the data across as many discs as you need. The program to restore all the footage is also automatically burned onto the discs.

  • Java.awt.Container.add(Container.java:345) how can i handle this

    dear all,
    i want to design an outlook for a chat applet. but this seems to tough as i am getting a run time error
    my code is:
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.*;
    import javax.swing.*;
    * the import that are required for this class
    public class outer extends Frame //implements ActionListener, Runnable
    private TextField txtusername,txtpassword,txtroomname;
    private Label lblusername,lblpassword,lblroomname,lbllistofrooms;
    Button okBtn,exitBut;
    Color backColor=null,btnBackClr=null,btnForeClr=null;
    String[] roomsavailable = {" one ", " two ", " three", " four"};
    private JList rooms = new JList(roomsavailable);
    /** the costructor*/
    public outer()
    { // super(st);
    backColor=new Color(200,200,255);
    btnBackClr=new Color(225,240,255);
    btnForeClr=new Color(205,205,205);
    setBackground(backColor);
    setLayout(null);
    lblusername = new Label("Username");
    lblusername.reshape(insets().left+5,insets().top+10,60,20);
    add(lblusername);
    txtusername=new TextField();
    txtusername.reshape(insets().left+75,insets().top+10,60,20);
    add(txtusername);
    lblpassword = new Label("Password");
    lblpassword.reshape(insets().left+5,insets().top+30,60,20);
    add(lblpassword);
    txtpassword=new TextField();
    txtpassword.reshape(insets().left+75,insets().top+30,60,20);
    add(txtpassword);
    lblroomname = new Label("Select Room");
    lblroomname.reshape(insets().left+5,insets().top+50,60,20);
    add(lblroomname);
    txtroomname=new TextField();
    txtroomname.reshape(insets().left+75,insets().top+50,60,20);
    add(txtroomname);
    okBtn=new Button("Login");
    okBtn.reshape(insets().left+25,insets().top+80,60,20);
    add(okBtn);
    // okBtn.addActionListener(this);
    exitBut=new Button("EXIT");
    exitBut.reshape(insets().left+50,insets().top+80,60,20);
    add(exitBut);
    // exitBut.addActionListener(this);
    public static void main(String[] args)
    // Create a JFrame
    JFrame frame = new JFrame("client side");
    // Create a outer class object
    outer outerobj = new outer();
    // Add the outer to the JFrame
    frame.getContentPane().add(outerobj, BorderLayout.WEST);
    // Set Jframe size
    frame.setSize(800, 400);
    //set resizable true
    frame.setResizable(true);
    // Set JFrame to visible
    frame.setVisible(true);
    // set the close operation so that the Application terminates when closed
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    when i compile it it compiles but gives run time error like this
    RUN TIME error:
    Exception in thread "main" java.lang.IllegalArgumentException: adding a window
    to a container
    at java.awt.Container.addImpl(Container.java:434)
    at java.awt.Container.add(Container.java:345)
    at outer.main(outer.java:75)
    Press any key to continue...
    i know erroe in this line
    frame.getContentPane().add(outerobj, BorderLayout.WEST);
    but how shall i add to get the proper layout by getting benifit of insets method
    reply soon
    please

    You can't add a frame to a frame.
    Try chaing the class definition from
    public class outer extends Frameto
    public class outer extends PanelPlease note to format your code (you'll get a faster response) use [ code]
    Object names should always start with a capital letter. outer --> Outer

  • How can you handle Third Party Payment in Oracle Payroll

    People I hope you all are at your Good Health!
    I have a question and that is i would like to know how i can restrict a dependent from getting an Insurance benefit after he has crossed the Age =18 Also the To date must be calculated and populated automatically.
    Also, how can we handle this third party payment in the Oracle Payroll.
    All comments are welcomed.
    Chetan

    For the payment piece, create a payment method on the person record as a third party. you would need to have setup the recieving party as a third party organization before setting up at employee level.
    During normal payroll processing, you may run Third party check writer to generate a check .
    Ankur thank you for the response i have understood that we must create a Payment Method and Check the Check box for Third party Payment on Payment Method window.But how will that be handled for case where an employee has taken a Loan from a Bank and he has to be deducted every month from his salary how can we handle such a requiremet.
    I did not understand when you said :
    "you would need to have setup the recieving party as a third party organization before setting up at employee level.
    During normal payroll processing, you may run Third party check writer to generate a check ."
    Could you please explain me.
    Regards,
    Chetan

  • How can I handle exception? - to give user more friendly notification

    Hi!
    User gets an error:
    'Error in mru internal routine: ORA-20001: Error in MRU: row= 1, ORA-20001: ORA-20001: Current version of data in database has changed since user initiated update process. current checksum =...'
    How can I handle this exception (when two users want to modify the same set of data at the same time)? I would like to hide the above error message and give user more friendly notification.
    Thanks in advance,
    Tom

    Thanks Vikas for your answer.
    These workarounds are really creative and I want to use one of them. BUT my problem is to 'catch' the exception/error when two users want to modify the same set of data at the same time.
    Those solutions which we can read about in this link you gave me describe handling exceptions in pl/sql processes. How can I catch the error I am talking about in pl/sql code?
    Code would be like this:
    DECLARE
    two_users EXCEPTION;
    BEGIN
    IF --catch the error
    THEN RAISE two_users;
    END IF;
    EXCEPTION WHEN two_users
    THEN :HIDDEN_ITEM := 'Error Message';
    END;
    What should I put in a place where there is '--catch the error' ??
    Thanks in advance,
    Tom

  • How can we handle Dead lines

    Hi friends,
       When a work item is created. The User hasn't Approved / Rejected  (hasnt taken any Action on that workflow) for 2 days, 4 days and 6 days an Escalation mail has to sent to respective concerend persons.
    How can we handle this. The holidays are only Saturday and Sunday.
    Client doesnt want to consider the factory calender.
    Please suggest me step by step
    Thanks in Advance
    Ganesh

    You need to make use of "Modelled Deadline Monitoring" to achieve ur requirement.
    Trust me... Search this forum and you will find answer how to make use of different steps to achieve it....
    Regards,
    PR.

  • HT204088 I was charged $21.09 for an application which I thought was $1.99 where do or how do I rectify this transaction?

    I was charged $21.09 for an application which I thought was $1.99. Where should or how can a rectify this purchase?

    Mac App Store Support -
    http://www.apple.com/support/mac/app-store/

  • How can we handle multiple applications in session method

    how can we handle multiple applications in .. session method.
    can any body reply me.
    thanks

    Hari,
    hi Check out this sample code to use session method
    REPORT  ztest_report
    NO STANDARD PAGE HEADING
                            LINE-SIZE 255
                            MESSAGE-ID ZRASH.
                    Internal Table Declarations                          *
    *--Internal Table for Data Uploading.
    DATA : BEGIN OF IT_FFCUST OCCURS 0,
             KUNNR(10),
             BUKRS(4),
             KTOKD(4),
             ANRED(15),
             NAME1(35),
             SORTL(10),
             STRAS(35),
             ORT01(35),
             PSTLZ(10),
             LAND1(3),
             SPRAS(2),
             AKONT(10),
           END OF IT_FFCUST.
    *--Internal Table to Store Error Records.
    DATA : BEGIN OF IT_ERRCUST OCCURS 0,
             KUNNR(10),
             EMSG(255),
           END OF IT_ERRCUST.
    *--Internal Table to Store Successful Records.
    DATA : BEGIN OF IT_SUCCUST OCCURS 0,
             KUNNR(10),
             SMSG(255),
           END OF IT_SUCCUST.
    *--Internal Table for Storing the BDC data.
    DATA : IT_CUSTBDC LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
    *--Internal Table for storing the messages.
    DATA : IT_CUSTMSG LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    DATA : V_FLAG1(1) VALUE ' ',
    "Flag used for opening session.
           V_TLINES LIKE SY-TABIX,
           "For storing total records processed.
           V_ELINES LIKE SY-TABIX,
           "For storing the no of error records.
           V_SLINES LIKE SY-TABIX.
           "For storing the no of success records.
             Selection screen                                            *
    SELECTION-SCREEN BEGIN OF BLOCK B1.
    PARAMETERS : V_FNAME LIKE RLGRAP-FILENAME,
                 V_SESNAM  LIKE RLGRAP-FILENAME.
    SELECTION-SCREEN END OF BLOCK B1.
             Start-of-selection                                          *
    START-OF-SELECTION.
    *-- Form to upload flatfile data into the internal table.
      PERFORM FORM_UPLOADFF.
           TOP-OF-PAGE                                                   *
    TOP-OF-PAGE.
      WRITE:/ 'Details of the error and success records for the transaction'
      ULINE.
      SKIP.
             End of Selection                                            *
    END-OF-SELECTION.
    *-- Form to Generate a BDC from the Uploaded Internal table
      PERFORM FORM_BDCGENERATE.
    *--To write the totals and the session name.
      PERFORM FORM_WRITEOP.
    *&      Form  form_uploadff
        Form to upload flatfile data into the internal table.
    FORM FORM_UPLOADFF .
    *--Variable to change the type of the parameter file name.
      DATA : LV_FILE TYPE STRING.
      LV_FILE = V_FNAME.
    *--Function to upload the flat file to the internal table.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          FILENAME                      =  LV_FILE
        FILETYPE                      = 'ASC'
          HAS_FIELD_SEPARATOR           = 'X'
        HEADER_LENGTH                 = 0
        READ_BY_LINE                  = 'X'
        DAT_MODE                      = ' '
      IMPORTING
        FILELENGTH                    =
        HEADER                        =
        TABLES
          DATA_TAB                      = IT_FFCUST
        EXCEPTIONS
          FILE_OPEN_ERROR               = 1
          FILE_READ_ERROR               = 2
          NO_BATCH                      = 3
          GUI_REFUSE_FILETRANSFER       = 4
          INVALID_TYPE                  = 5
          NO_AUTHORITY                  = 6
          UNKNOWN_ERROR                 = 7
          BAD_DATA_FORMAT               = 8
          HEADER_NOT_ALLOWED            = 9
          SEPARATOR_NOT_ALLOWED         = 10
          HEADER_TOO_LONG               = 11
          UNKNOWN_DP_ERROR              = 12
          ACCESS_DENIED                 = 13
          DP_OUT_OF_MEMORY              = 14
          DISK_FULL                     = 15
          DP_TIMEOUT                    = 16
          OTHERS                        = 17
      IF SY-SUBRC = 0.
    *--Deleting the headings from the internal table.
        DELETE IT_FFCUST INDEX 1.
    *--Getting the total number of records uploaded.
        DESCRIBE TABLE IT_FFCUST LINES V_TLINES.
      ENDIF.
    ENDFORM.                    " form_uploadff
    *&      Form  Form_bdcgenerate
        Form to Generate a BDC from the Uploaded Internal table
    FORM FORM_BDCGENERATE .
    *--Generating the BDC table for the fields of the internal table.
      LOOP AT IT_FFCUST.
        PERFORM POPULATEBDC USING :
                                    'X' 'SAPMF02D' '0105',
                                    ' ' 'BDC_OKCODE'  '/00' ,
                                    ' ' 'RF02D-KUNNR' IT_FFCUST-KUNNR,
                                    ' ' 'RF02D-BUKRS' IT_FFCUST-BUKRS,
                                    ' ' 'RF02D-KTOKD' IT_FFCUST-KTOKD,
                                    'X' 'SAPMF02D' '0110' ,
                                    ' ' 'BDC_OKCODE'  '/00',
                                    ' ' 'KNA1-ANRED'  IT_FFCUST-ANRED,
                                    ' ' 'KNA1-NAME1' IT_FFCUST-NAME1,
                                    ' ' 'KNA1-SORTL'  IT_FFCUST-SORTL,
                                    ' ' 'KNA1-STRAS' IT_FFCUST-STRAS,
                                    ' ' 'KNA1-ORT01' IT_FFCUST-ORT01,
                                    ' ' 'KNA1-PSTLZ' IT_FFCUST-PSTLZ,
                                    ' ' 'KNA1-LAND1' IT_FFCUST-LAND1,
                                    ' ' 'KNA1-SPRAS' IT_FFCUST-SPRAS,
                                    'X' 'SAPMFO2D' '0120',     
                                    ' ' 'BDC_OKCODE'  '/00',
                                    'X' 'SAPMF02D' '0125',     
                                    ' ' 'BDC_OKCODE'  '/00',
                                    'X' 'SAPMF02D' '0130',     
                                    ' ' 'BDC_OKCODE'  '=ENTR',
                                    'X' 'SAPMF02D' '0340',     
                                    ' ' 'BDC_OKCODE'  '=ENTR',
                                    'X' 'SAPMF02D' '0360',
                                    ' ' 'BDC_OKCODE'  '=ENTR',
                                    'X' 'SAPMF02D' '0210',     
                                    ' ' 'KNB1-AKONT'  IT_FFCUST-AKONT,
                                    ' ' 'BDC_OKCODE'  '/00',
                                    'X' 'SAPMF02D' '0215',
                                    ' ' 'BDC_OKCODE'  '/00',
                                    'X' 'SAPMF02D' '0220',     
                                    ' ' 'BDC_OKCODE'  '/00',
                                    'X' 'SAPMF02D' '0230',     
                                    ' ' 'BDC_OKCODE'  '=UPDA'.
    *--Calling the transaction 'fd01'.
        CALL TRANSACTION 'FD01' USING IT_CUSTBDC MODE 'N' UPDATE 'S'
        MESSAGES INTO IT_CUSTMSG.
        IF SY-SUBRC <> 0.
    *--Populating the error records internal table.
          IT_ERRCUST-KUNNR = IT_FFCUST-KUNNR.
          APPEND IT_ERRCUST.
          CLEAR IT_ERRCUST.
    *--Opening a session if there is an error record.
          IF V_FLAG1 = ' '.
            PERFORM FORM_OPENSESSION.
            V_FLAG1 = 'X'.
          ENDIF.
    *--Inserting the error records into already open session.
          IF V_FLAG1 = 'X'.
            PERFORM FORM_INSERT.
          ENDIF.
    *--Populating the Success records internal table.
        ELSE.
          IT_SUCCUST-KUNNR = IT_FFCUST-KUNNR.
          APPEND IT_SUCCUST.
          CLEAR IT_SUCCUST.
        ENDIF.
    *--Displaying the messages.
        IF NOT IT_CUSTMSG[] IS INITIAL.
          PERFORM FORM_FORMATMSG.
        ENDIF.
    *--Clearing the message and bdc tables.
        CLEAR : IT_CUSTBDC[],IT_CUSTMSG[].
      ENDLOOP.
    *--Getting the total no of error records.
      DESCRIBE TABLE IT_ERRCUST LINES V_ELINES.
    *--Getting the total no of successful records.
      DESCRIBE TABLE IT_SUCCUST LINES V_SLINES.
    *--Closing the session only if it is open.
      IF V_FLAG1 = 'X'.
        PERFORM FORM_CLOSESESS.
      ENDIF.
    ENDFORM.                    " Form_bdcgenerate
    *&      Form  populatebdc
          FOrm to Populate the BDC table.
    FORM POPULATEBDC  USING    VALUE(P_0178)
                               VALUE(P_0179)
                               VALUE(P_0180).
      IF P_0178 = 'X'.
        IT_CUSTBDC-PROGRAM = P_0179.
        IT_CUSTBDC-DYNPRO = P_0180.
        IT_CUSTBDC-DYNBEGIN = 'X'.
      ELSE.
        IT_CUSTBDC-FNAM = P_0179.
        IT_CUSTBDC-FVAL = P_0180.
      ENDIF.
      APPEND IT_CUSTBDC.
      CLEAR IT_CUSTBDC.
    ENDFORM.                    " populatebdc
    *&      Form  FORM_OPENSESSION
          Form to Open a session.
    FORM FORM_OPENSESSION .
    *--Variable to convert the given session name into reqd type.
      DATA : LV_SESNAM(12).
      LV_SESNAM = V_SESNAM.
    *--Opening a session.
      CALL FUNCTION 'BDC_OPEN_GROUP'
       EXPORTING
         CLIENT                    = SY-MANDT
         GROUP                     = LV_SESNAM
         HOLDDATE                  = '20040805'
         KEEP                      = 'X'
         USER                      = SY-UNAME
         PROG                      = SY-CPROG
    IMPORTING
       QID                       =
       EXCEPTIONS
         CLIENT_INVALID            = 1
         DESTINATION_INVALID       = 2
         GROUP_INVALID             = 3
         GROUP_IS_LOCKED           = 4
         HOLDDATE_INVALID          = 5
         INTERNAL_ERROR            = 6
         QUEUE_ERROR               = 7
         RUNNING                   = 8
         SYSTEM_LOCK_ERROR         = 9
         USER_INVALID              = 10
         OTHERS                    = 11
      IF SY-SUBRC <> 0.
        WRITE :/ 'Session not open'.
      ENDIF.
    ENDFORM.                    " FORM_OPENSESSION
    *&      Form  FORM_INSERT
          fORM TO INSERT ERROR RECOED INTO A SESSION.
    FORM FORM_INSERT .
    *--Inserting the record into session.
      CALL FUNCTION 'BDC_INSERT'
        EXPORTING
          TCODE                  = 'FD01'
        POST_LOCAL             = NOVBLOCAL
        PRINTING               = NOPRINT
        SIMUBATCH              = ' '
        CTUPARAMS              = ' '
        TABLES
          DYNPROTAB              = IT_CUSTBDC
        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.
        WRITE :/ 'Unable to insert the record'.
      ENDIF.
    ENDFORM.                    " FORM_INSERT
    *&      Form  FORM_CLOSESESS
          Form to Close the Open Session.
    FORM FORM_CLOSESESS .
      CALL FUNCTION 'BDC_CLOSE_GROUP'
        EXCEPTIONS
          NOT_OPEN    = 1
          QUEUE_ERROR = 2
          OTHERS      = 3.
      IF SY-SUBRC <> 0.
      ENDIF.
    ENDFORM.                    " FORM_CLOSESESS
    *&      Form  FORM_FORMATMSG
          Form to format messages.
    FORM FORM_FORMATMSG .
    *--Var to store the formatted msg.
      DATA : LV_MSG(255).
      CALL FUNCTION 'FORMAT_MESSAGE'
        EXPORTING
          ID        = SY-MSGID
          LANG      = SY-LANGU
          NO        = SY-MSGNO
          V1        = SY-MSGV1
          V2        = SY-MSGV2
          V3        = SY-MSGV3
          V4        = SY-MSGV4
        IMPORTING
          MSG       = LV_MSG
        EXCEPTIONS
          NOT_FOUND = 1
          OTHERS    = 2.
      IF SY-SUBRC = 0.
        WRITE :/ LV_MSG.
      ENDIF.
      ULINE.
    ENDFORM.                    " FORM_FORMATMSG
    *&      Form  form_writeop
          To write the totals and the session name.
    FORM FORM_WRITEOP .
      WRITE :/ 'Total Records Uploaded :',V_TLINES,
               / 'No of Error Records :',V_ELINES,
               / 'No of Success Records :',V_SLINES,
               / 'Name of the Session :',V_SESNAM.
      ULINE.
    ENDFORM.                    " form_writeop
    Don't forget to reward if useful..

Maybe you are looking for