How to write code for this logic in a routine, very urgent --help me

hi all,
i want to apply this logic into one subroutin ZABC.
here i m giving my logic ,can any body help me in coding for this, this is very urgent, i hv to submit on wednesday.
4.1 Read the company code number BSEG-BUKRS from document line item.
4.2 Fetch PRDHA from MARA into GV_PRDHA where MATNR = BSEG-MATNR.
4.3 Fetch Business area (GSBER) from ZFIBU into GV_GSBER where (PRDHA = GV_PRDHA and BUKRS = BSEG-BUKRS) OR (PRDHA = GV_PRDHA and BUKRS = SPACE).
4.4 If business area match is found, go to step 3.9. Else continue.
4.5 If BKPF-BLART IN set “ZVS_POSDT” OR BKPF-XBLNR starts with “I0*”, execute steps below. Else, go to Step 3.6.
i. MOVE: BSEG-BKURS TO work area field WA_ZFIBUE-BUKRS,
BSEG-MATNR TO work area field WA_ZFIBUE-MATNR,
GV_PRDHA TO work area field WA_ZFIBUE-PRDHA,
BSEG-HKONT TO work area field WA_ZFIBUE-HKONT,
BSEG-GSBER TO work area field WA_ZFIBUE-GSBER,
BSEG-PSWBT TO work area field WA_ZFIBUE-PSWBT,
BKPF-BUDAT TO work area field WA_ZFIBUE-BUDAT,
SY-DATUM TO work area field WA_ZFIBUE-CREDATE,
SY-UZEIT TO work area field WA_ZFIBUE-CRETIME,
Fetch running serial number (WA_ZFIBUE-SERIALNO) from ZFICO. This number will be stored in ZFICO with PARAMTYPE = "BPM030307", SUBTYPE = "ZFIBUE" and KEY1 = "SERIALNO". The actual serial number will be stored in the field VALUE1.
i. Insert WA_ZFIBUE INTO ZFIBUE.
ii. Send email notification to the user (if it is not already sent to user on the same posting date).
Use function module ‘SO_NEW_DOCUMENT_ATT_SEND_API1’ to send mail.
Fetch email address and date of last email from ZFICO. These values will be stored in ZFICO with PARAMTYPE = "BPM030307", SUBTYPE = "EMAIL" and KEY1 = "<USERNAME>". The email address will be stored in the field VALUE1 and posting date in VALUE2. Once mail is sent, VALUE2 is updated with latest posting date (BKPF-BUDAT).
iii. Increment the running serial number and update ZFICO with new serial number.
a. GV_ SERIALNO = WA_ZFIBUE-SERIALNO + 1
b. Update ZFICO Set value1 = GV_SERIALNO
Where PARAMTYPE = "BPM030307" AND
SUBTYPE = "ZFIBUE" AND
KEY1 = "SERIALNO".
iv Move “VDFT” to BSEG-GSBER.
v. Exit routine.
4.6 Fetch MTART into GV_MTART from MARA where MATNR = BSEG-MATNR.
4.7 If SY-BATCH = INITIAL AND GV_MTART <> ‘ROH’, issue the error message - “Maintain the mapping of product hierarchy <PRDHA> from article <MATNR> for <BUKRS>”. Else, go to step 3.8.
4.8 If SY-BATCH <> INITIAL AND GV_MTART <> ‘ROH’, issue the error message - “Maintain product hierarchy on article master”. Go to step 3.10.
4.9 Move GV_GSBER TO BSEG-GSBER.
4.10 Exit Routine
plz give me reply asap --this is very urgent
thanks in advance
swathi

Hi Swathi,
If it's very very urgent then you better get on with it, don't waste time on the web. Chop chop.

Similar Messages

  • How to write code for this logic, plz help me very urgent

    Hi All,
    i am new to sap-abap, i got this work and i m working on this can any body help me in writing code, plz help me, this is very very urgent.
    here  i m giving my logic, can anybody send me the code related to this logic.
    this is very urgent .
    this program o/p should be in ALV format and need to create one commond 'SAVE" on this o/t list  if  user clicks save processedon and processedby fields in ZFIBUE should be updated automatically.
    i am creating one custom table zfibue having fields: (serialno, bukrs, matnr,prdha,hkont,gsber,wrbtr,budat, credate, cretime,processed, processedon, processedby,mapped)
    fields of zfibue:
    serailno = numc
    bukrs = char
    matnr = char
    prdha = char
    hkont = char
    gsber = char
    wrbtr = char
    budat = date
    credate = date
    cretime = time
    processed= char
    processedon = date
    processedby = char
    mapped = char      are   belongs to above type data types
    and seelct-optionfields:  s_bukrs for bseg-bukrs
                                        s_hkont for bseg-hkont,
                                         s_budat for bkpf-budat,
                                         s_processed for zfibue-processed,
                                          s_processedon for zfibue-processedon,
                                          s_mapped. for zfibue-mapped
    parameters: p_chk1 as checkbox,
                      p_chk2 as checkbox.
                      p_filepath type rlgrap-filename.
    1.1 Validate the user inputs (S_BUKRS and S_HKONT) against respective check tables (T001 and SKB1). If the validation fails, provide respective error message. Eg: “Invalid input for Company Code”.
    1.2 Fetch SERIALNO, BUKRS, MATNR, PRDHA, HKONT, GSBER, WRBTR, BUDAT, CREDATE, CRETIME, PROCESSED, PROCESSEDON, PROCESSEDBY, MAPPED from table ZFIBUE into internal table GT_ZFIBUE where BUKRS IN S_BUKRS, HKONT IN S_HKONT, BUDAT IN S_BUDAT, PROCESSED IN S_PROCESSED, PROCESSEDON IN S_PROCESSEDON, and MAPPED IN S_MAPPED.
    1.3 If P_CHK2 = ‘X’, go to step 1.11. Else continue.
    1.4 If P_CHK1 = ‘X’, continue. Else go to step 1.9
    1.5 Fetch MATNR, PRDHA from MARA into GT_MARA for all entries in GT_ZFIBUE where MATNR = GT_ZFIBUE-MATNR.
    1.6 Sort and delete adjacent duplicates from GT_MARA based on MATNR.
    1.7 Loop through GT_ZFIBUE where PRDHA = blank.
              Read Table GT_MARA based on MATNR = GT_ZFIBUE-MATNR.
              IF sy-subrc = 0.
                     Move GT_MARA-PRDHA to GT_ZFIBUE-PRDHA.
                  Modify Table GT_ZFIBUE. “Update Product Hierarchy
                 Endif.
        Fetch PRDHA, GSBER from ZFIBU into GT_ZFIBU for all entries in GT_ZFIBUE where PRDHA = GT_ZFIBUE-PRDHA.
        Read Table GT_ZFIBU based on PRDHA = GT_ZFIBUE-PRDHA.
              IF sy-subrc = 0.
                     Move GT_ZFIBU-GSBER to GT_ZFIBUE-GSBER.
                  Move “X” to GT_ZFIBUE-MAPPED.      
                  Modify Table GT_ZFIBUE.
                 Endif.   
    Endloop.
    1.8 Modify database table ZFIBUE from GT_ZFIBUE.
    1.9 Fill the field catalog table GT_FIELDCAT using the details of output fields listed in section “Inputs/Outputs” (above).
       Eg:                 LWA_ FIELDCAT -SELTEXT_L = 'Serial Number’.
                              LWA_ FIELDCAT -DATATYPE = ‘NUMC’.
                              LWA_ FIELDCAT -OUTPUTLEN = 9.
                              LWA_ FIELDCAT -TABNAME = 'GT_ZFIBUE'.
                              LWA_ FIELDCAT-FIELDNAME = 'SERIALNO'.
              Append LWA_FIELDCAT to GT_FIELDCAT
    Note: a) The output field GT_ZFIBUE-PROCESSED will be editable marking INPUT = “X” in field catalog (GT_FIELDCAT).
             b) The standard ALV functionality will be used to give the user option for selecting all or blocks of entries at a time.
             c) The PF-STATUS STANDARD_FULLSCREEN from function group SLVC_FULLSCREEN will be copied to the program and modified to include a “SAVE” button.
    1.10 Call the function module REUSE_ALV_GRID_DISPLAY passing output table GT_ZFIBUE and field catalog GT_FIELDCAT. Additional parameters like I_CALLBACK_PF_STATUS_SET (= ‘ZFIBUESTAT’) and I_CALLBACK_USER_COMMAND (=’HANDLE_USER_ACTION’) will also be passed to handle user events. Go to 2.14.
    1.11 Download the file to P_FILEPATH using function module GUI_DOWNLOAD passing GT_ZFIBUE.
    1.12 Exit Program.
    Logic to be implemented in  routine “Handle_User_Action”
    This routine will have the following interface:
    FORM Handle_User_Action  USING r_ucomm LIKE sy-ucomm
                                                               rs_selfield TYPE slis_selfield.
    ENDFORM.
    Following logic will be implemented in this routine:
    1.     If r_ucomm = ‘SAVE’, continue. Else exit.
    2.     Loop through GT_ZFIBUE where SEL_ROW = ‘X’. “Row is selected
    a.     IF GT_ZFIBUE-PROCESSED = ‘X’.
    i.     GT_ZFIBUE-PROCESSEDON = SY-DATUM.
    ii.     GT_ZFIBUE-PROCESSEDBY = SY-UNAME.
    iii.     MODIFY ZFIBUE FROM work area GT_ZFIBUE.
    Endif.
    Endloop.

    Hi Swathi,
    If it's very very urgent then you better get on with it, don't waste time on the web. Chop chop.

  • Classical report how to write code for this task

    coding
    Delivery Due List: This Report program generates list with details of quantity available, quantity planned, quantity delivered and quantity still to be delivered for sales orders and stock transport orders based on shipping point

    Hi,
    Try to get TABLE and FIELD names from your senoir or functional consultants.
    or
    search the field names in the following tables...
    VBAP
    LIPS
    VBRP.
    Regards,
    Billa

  • How to write code for page up and page down buttons on alv screen?

    Hi,
    Page up and page down buttons are not working in general alv report. Thease buttons are in disable mode. But is stnd. transactions (tcode : fbl5n)  these are enabled and working properly, but we can't debug this with /h
    How to write code for page up and page down buttons on alv screen?

    Poonam,
    On doing the screen debugging it took me over to    Include LSTXWFCC ,kindly check the below code.
    module cc_display.
      fcode = sy-ucomm(4).
      case sy-ucomm(4).
        when 'P--'.
          perform cc_firstpage.
        when 'P-'.
          perform cc_prevpage.
        when 'P+'.
          perform cc_nextpage.
        when 'P++'.
          perform cc_lastpage.
        when 'EX--'.
          perform cc_firstcopy.
        when 'EX-'.
          perform cc_prevcopy.
        when 'EX+'.
          perform cc_nextcopy.
        when 'EX++'.
          perform cc_lastcopy.
    I guess it can give you some lead.
    K.Kiran.

  • How  to write code for font family using swing?

    how to write code for font family using swing?
    i tried this code.but i got only font styles.but i need font family.observ this code
    import java.awt.*;
    import java.awt.event.*;
    public class fontSelect extends java.awt.Dialog implements AdjustmentListener, ItemListener, TextListener, ActionListener {
    public Font selectedFont; //to get result
    public boolean isSelected = false;
    public Color selectedBackground, selectedForeground;
         public fontSelect(Frame parent, boolean modal) {
              super(parent, modal);
         String fntName[] = getToolkit().getFontList();
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    String[] names = ge.getAvailableFontFamilyNames();
              //{{INIT_CONTROLS
              setLayout(null);
              setVisible(false);
    //setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              setSize(insets().left + insets().right + 380,insets().top + insets().bottom + 282);
              setBackground(java.awt.Color.lightGray);
    fontList = new java.awt.Choice();
              //fontList = new java.awt.List(0,false);
              add(fontList);
              fontList.setBounds(insets().left +25,insets().top + 50,137,144);
              //label1 = new java.awt.Label("Example:-");
              //label1.setBounds(insets().left + 220,insets().top + 36,84,30);
              //add(label1);
              exampleText = new java.awt.TextField();
              //exampleText.setText("sample string ");
              //exampleText.setBounds(insets().left + 40,insets().top + 50,84,21);
              //add(exampleText);
              label2 = new java.awt.Label("Font Family:-");
              label2.setBounds(insets().left + 25,insets().top + 30,70,19);
              add(label2);
              isBold = new java.awt.Checkbox("Bold");
              isBold.setBounds(insets().left + 320,insets().top + 90,60,18);
              isBold.setFont(new Font("Times New Roman", Font.BOLD, 12));
              add(isBold);
              isItalic = new java.awt.Checkbox("Italic");
              isItalic.setBounds(insets().left + 250,insets().top + 90,48,17);
              isItalic.setFont(new Font("Times New Roman", Font.ITALIC, 12));
              add(isItalic);
              showFont = new java.awt.Label("samplestring ",Label.CENTER);
              showFont.setBounds(insets().left + 240,insets().top +50,120,30);
              showFont.setBackground(java.awt.Color.white);
              add(showFont);
    label11 = new java.awt.Label("Size:-");
              label11.setBounds(insets().left + 290,insets().top + 120,70,19);
              add(label11);
              fontSize = new java.awt.Choice();
    add(fontSize);
              //label11 = new java.awt.Label("Example string");
              fontSize.setBounds(insets().left + 290,insets().top + 140,60,23);
              fontSize.setBackground(java.awt.Color.white);
              btnSelect = new java.awt.Button();
              btnSelect.setLabel("Select");
              btnSelect.setBounds(insets().left + 280,insets().top + 190,87,24);
              add(btnSelect);
              btnCancel = new java.awt.Button();
              btnCancel.setLabel("Cancel");
              btnCancel.setBounds(insets().left + 280,insets().top + 230,91,24);
              add(btnCancel);
              label3 = new java.awt.Label("Background:-");
              label3.setBounds(insets().left + 24,insets().top + 90,94,18);
              add(label3);
              rBackground = new java.awt.Scrollbar(Scrollbar.HORIZONTAL,255,0,0,255);
              rBackground.setBounds(insets().left + 24,insets().top +110 ,197,21);
              add(rBackground);
              gBackground = new java.awt.Scrollbar(Scrollbar.HORIZONTAL,255,0,0,255);
              gBackground.setBounds(insets().left + 24,insets().top + 135,197,21);
              add(gBackground);
              bBackground = new java.awt.Scrollbar(Scrollbar.HORIZONTAL,255,0,0,255);
              bBackground.setBounds(insets().left + 24,insets().top + 160,197,21);
              add(bBackground);
              label4 = new java.awt.Label("R");
              label4.setBounds(insets().left + 12,insets().top + 110,12,18);
              label4.setFont(new Font("Times New Roman", Font.BOLD, 12));
              label4.setForeground(java.awt.Color.red);
              add(label4);
              label5 = new java.awt.Label("G");
              label5.setBounds(insets().left + 12,insets().top + 135,12,18);
              label5.setFont(new Font("Times New Roman", Font.BOLD, 12));
              label5.setForeground(new Color(-16744448));
              add(label5);
              label6 = new java.awt.Label("B");
              label6.setBounds(insets().left + 12,insets().top + 160,12,18);
              label6.setFont(new Font("Times New Roman", Font.BOLD, 12));
              label6.setForeground(java.awt.Color.blue);
              add(label6);
              rBackValue = new java.awt.Label("255");
              rBackValue.setBounds(insets().left + 225,insets().top + 110,24,12);
              rBackValue.setFont(new Font("Times New Roman", Font.BOLD, 12));
              rBackValue.setForeground(java.awt.Color.red);
              add(rBackValue);
              gBackValue = new java.awt.Label("255");
              gBackValue.setBounds(insets().left + 225,insets().top + 135,24,12);
              gBackValue.setFont(new Font("Times New Roman", Font.BOLD, 12));
              gBackValue.setForeground(new Color(-16744384));
              add(gBackValue);
              bBackValue = new java.awt.Label("255");
              bBackValue.setBounds(insets().left + 225,insets().top + 160,24,12);
              bBackValue.setFont(new Font("Times New Roman", Font.BOLD, 12));
              bBackValue.setForeground(java.awt.Color.blue);
              add(bBackValue);
              label7 = new java.awt.Label("Foreground:-");
              label7.setBounds(insets().left + 20,insets().top + 185,94,18);
              add(label7);
              rForeground = new java.awt.Scrollbar(Scrollbar.HORIZONTAL,0,0,0,255);
              rForeground.setBounds(insets().left + 20,insets().top + 205,197,21);
              add(rForeground);
              gForeground = new java.awt.Scrollbar(Scrollbar.HORIZONTAL,0,0,0,255);
              gForeground.setBounds(insets().left + 20,insets().top + 230,197,21);
              add(gForeground);
              bForeground = new java.awt.Scrollbar(Scrollbar.HORIZONTAL,0,0,0,255);
              bForeground.setBounds(insets().left + 20,insets().top + 255,197,21);
              add(bForeground);
              label8 = new java.awt.Label("R");
              label8.setBounds(insets().left + 10,insets().top + 205,12,18);
              label8.setFont(new Font("Times New Roman", Font.BOLD, 12));
              label8.setForeground(java.awt.Color.red);
              add(label8);
              label9 = new java.awt.Label("G");
              label9.setBounds(insets().left + 10,insets().top + 230,12,18);
              label9.setFont(new Font("Times New Roman", Font.BOLD, 12));
              label9.setForeground(new Color(-16744448));
              add(label9);
              label10 = new java.awt.Label("B");
              label10.setBounds(insets().left + 10,insets().top + 255,12,18);
              label10.setFont(new Font("Times New Roman", Font.BOLD, 12));
              label10.setForeground(java.awt.Color.blue);
              add(label10);
              rForeValue = new java.awt.Label("255");
              rForeValue.setBounds(insets().left + 220,insets().top + 205,24,12);
              rForeValue.setFont(new Font("Times New Roman", Font.BOLD, 12));
              rForeValue.setForeground(java.awt.Color.red);
              add(rForeValue);
              gForeValue = new java.awt.Label("255");
              gForeValue.setBounds(insets().left + 220,insets().top + 230,24,12);
              gForeValue.setFont(new Font("Times New Roman", Font.BOLD, 12));
              gForeValue.setForeground(new Color(-16744384));
              add(gForeValue);
              bForeValue = new java.awt.Label("255");
              bForeValue.setBounds(insets().left + 220,insets().top + 255,24,12);
              bForeValue.setFont(new Font("Times New Roman", Font.BOLD, 12));
              bForeValue.setForeground(java.awt.Color.blue);
              add(bForeValue);
              setTitle("Choosing font");
              //{{REGISTER_LISTENERS
              exampleText.addTextListener(this);
              btnSelect.addActionListener(this);
              btnCancel.addActionListener(this);
              isBold.addItemListener(this);
              fontList.addItemListener(this);
              isItalic.addItemListener(this);
              fontSize.addItemListener(this);
              rBackground.addAdjustmentListener(this);
              gBackground.addAdjustmentListener(this);
              bBackground.addAdjustmentListener(this);
              rForeground.addAdjustmentListener(this);
              gForeground.addAdjustmentListener(this);
              bForeground.addAdjustmentListener(this);
    for (int i = 0; i < (int)fntName.length; i++)
    fontList.addItem(fntName);
              showFont.setFont(new Font(fntName[0], Font.PLAIN, 12));
    // GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    //String[] names = ge.getAvailableFontFamilyNames();
    for ( int i=0; i<names.length; i++ )
    System.out.println( names[i] );
              selectedBackground = showFont.getBackground();
              selectedForeground = showFont.getForeground();
              int i = 8;
              do {
                   fontSize.addItem(""+i);
                   if (i<=30) i+=2;
                   else if (i<=70) i+=4;
                   else i+=8;
              } while (i<150);
              try {
                   fontSize.select(2);
              } catch (IllegalArgumentException e) { }
         //{{DECLARE_CONTROLS
         //java.awt.List fontList;
    java.awt.Label label11;
         java.awt.Label label1;
         java.awt.TextField exampleText;
         java.awt.Label label2;
         java.awt.Checkbox isBold;
         java.awt.Checkbox isItalic;
         java.awt.Label showFont;
         java.awt.Choice fontSize;
    java.awt.Choice fontList;
         java.awt.Button btnSelect;
         java.awt.Button btnCancel;
         java.awt.Label label3;
         java.awt.Scrollbar rBackground;
         java.awt.Scrollbar gBackground;
         java.awt.Scrollbar bBackground;
         java.awt.Label label4;
         java.awt.Label label5;
         java.awt.Label label6;
         java.awt.Label rBackValue;
         java.awt.Label gBackValue;
         java.awt.Label bBackValue;
         java.awt.Label label7;
         java.awt.Scrollbar rForeground;
         java.awt.Scrollbar gForeground;
         java.awt.Scrollbar bForeground;
         java.awt.Label label8;
         java.awt.Label label9;
         java.awt.Label label10;
         java.awt.Label rForeValue;
         java.awt.Label gForeValue;
         java.awt.Label bForeValue;
    private Font constructFont() {
    int l;
    try {
    l = Integer.parseInt(fontSize.getSelectedItem());
    } catch (NumberFormatException e) {l = 12;}
    selectedFont = new Font(fontList.getItem(fontList.getSelectedIndex()>=0?fontList.getSelectedIndex():0 ), (isBold.getState()?Font.BOLD:0)+(isItalic.getState()?Font.ITALIC:0), l);
    selectedBackground = new Color(rBackground.getValue(), gBackground.getValue(), bBackground.getValue());
    selectedForeground = new Color(rForeground.getValue(), gForeground.getValue(), bForeground.getValue());
    return (selectedFont);
         public void textValueChanged(java.awt.event.TextEvent event) {
              Object object = event.getSource();
              if (object == exampleText) showFont.setText(exampleText.getText());
         public void actionPerformed(java.awt.event.ActionEvent event) {
              Object object = event.getSource();
              if (object == btnSelect) {
    isSelected = true;
    selectedFont = constructFont();
         dispose();
    } else if (object == btnCancel) {
         selectedFont = null;
    selectedBackground = null;
    selectedForeground = null;
    dispose();
         public void itemStateChanged(java.awt.event.ItemEvent event) {
              Object object = event.getSource();
              if (object == isBold) showFont.setFont(constructFont());
              else if (object == fontList) showFont.setFont(constructFont());
              else if (object == isItalic) showFont.setFont(constructFont());
              else if (object == fontSize) showFont.setFont(constructFont());
         public void adjustmentValueChanged(java.awt.event.AdjustmentEvent event)
              Object object = event.getSource();
    constructFont();
    showFont.setBackground(new Color(rBackground.getValue(), gBackground.getValue(), bBackground.getValue()));
    showFont.setForeground(new Color(rForeground.getValue(), gForeground.getValue(), bForeground.getValue()));
    if (object == rBackground) rBackValue.setText(""+rBackground.getValue());
              else if (object == gBackground) gBackValue.setText(""+gBackground.getValue());
              else if (object == bBackground) bBackValue.setText(""+bBackground.getValue());
              else if (object == rForeground) rForeValue.setText(""+rForeground.getValue());
              else if (object == gForeground) gForeValue.setText(""+gForeground.getValue());
              else if (object == bForeground) bForeValue.setText(""+bForeground.getValue());

    Okay, that's better. It would have been nice if the code was formatted, and if there was about 20% of that code. (Your example could have been just one JLabel and nothing else, for example.)
    Anyway, now that you've posted that code, what is your question about it? I see you are calling a "getAvailableFontFamilyNames" method; do you have a question about that? If so, what is the question?

  • Write code for this its urgent

    hi its a alv bills of material report plz write code for this
    Develop a report to high light the bom and/or master receipes fall into the constrained planning horizon those are not ready for porduction
    this report will identity the items with a bom with a status other that 03(ready for production) and/or master receips witha a status other than 04(released). the items will be reveiwed in predefined horizon.
    within a few weeks of entering the 18 th week constrained planning horizon.
    for this report take bom tables stko,stpo,mast.
    in sel-scren take mrp controller, plant, divison.
    send immedialtly

    Brother this is not the correct way to ask.
    In your words you are commanding...
    But we have to request the EXPERTS.
    WE are in learning stage dont order or command.
    Just request them in another way...... then only u get the required reply....
    With regards,
    Prasad.

  • How to write code  for totals and subtotals in alv programing?

    how to write code  for totals and subtotals in alv programing?

    hi,
    1. <u><b>TOTAL.</b></u>
    http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_basic.htm
    2. <u><b>How do I add subtotals</b></u>
    http://www.sapfans.com/forums/viewtopic.php?t=20386
    http://www.sapfans.com/forums/viewtopic.php?t=85191
    http://www.sapfans.com/forums/viewtopic.php?t=88401
    http://www.sapfans.com/forums/viewtopic.php?t=17335
    Regards
    Anver

  • How to write code for save file directory?

    how to write code for save file directory?

    how to find usa timezone code using java swing?
    i have some code help me
    public class ItsInitializer {
    private static boolean s_initialized = false;
    private ItsInitializer() {
    public static synchronized void initialize() {
    if (!s_initialized) {
    // Modifies default time zone, disables Daylight Saving Time.
    TimeZone l_defaultTimeZone = TimeZone.getDefault();
    int l_rawOffset = l_defaultTimeZone.getRawOffset();
    String l_id = l_defaultTimeZone.getID();
    SimpleTimeZone l_simpleTimeZone = new SimpleTimeZone(l_rawOffset,
    l_id,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0);
    TimeZone.setDefault(l_simpleTimeZone);
    s_initialized = true;
    2.
    long timeMillis = ...;
    long time = timeMillis / 1000;
    String seconds = Integer.toString((int)(time % 60));
    String minutes = Integer.toString((int)((time % 3600) / 60));
    String hours = Integer.toString((int)(time / 3600));
    for (int i = 0; i < 2; i++) {
         if (seconds.length() < 2) {
              seconds = "0" + seconds;
         if (minutes.length() < 2) {
              minutes = "0" + minutes;
         if (hours.length() < 2) {
              hours = "0" + hours;
    3.
    import java.text.SimpleDateFormat;
    import java.util.Date;
    public class Convert {
    public String getDateTime(String pattern){
    SimpleDateFormat sdf = new SimpleDateFormat(pattern);
    return sdf.format(new Date());
    * @param args
    public static void main(String[] args) {
    Convert con = new Convert();
    System.out.println(con.getDateTime("hh:mm:ss"));
    5.import java.text.SimpleDateFormat;
    import java.util.Date;
    public class Convert {
    public String getDateTime(String pattern){
    SimpleDateFormat sdf = new SimpleDateFormat(pattern);
    return sdf.format(new Date());
    * @param args
    public static void main(String[] args) {
    Convert con = new Convert();
    System.out.println(con.getDateTime("hh:mm:ss"));
    [ November 23, 2005: Mess
    private Locale locale = Locale.US;
    private static final String[] tzStrings = {
    "America/New_York",
    "America/Chicago",
    "America/Denver",
    "America/Los_Angeles",
    Date now = new Date();
    for ( TimeZone z : zones) {
    DateFormat df = new SimpleDateFormat("K:mm a,z", locale);
    df.setTimeZone(z);
    String result = df.format(now);
    System.out.println(result);
    String date="05/19/2008 04:30 AM (EST)";
                   SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy hh:mm aaa (z)");
                   TimeZone.setDefault(TimeZone.getTimeZone("PST"));
                   long millis = sdf.parse(date).getTime();
                   sdf.setTimeZone(TimeZone.getDefault());
                   System.out.println(sdf.format(new Date(millis)));
    [ November 23, 2005: Mes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to write query for this in TopLink ?

    I am doing a simple search in jsp where the search will the based on the choices chosen by user.
    I had given 3 check boxes for those choices.
    The problem is, query will be based on the choice or choices chosed by the user.
    How to write query for this in TopLink ?
    Thanks in Advance..
    Jayaganesh

    Try below solution, it is NOT best solution but might work:
    Declare @Questions TABLE (QuestionID INT, QuestionText Varchar(100))
    INSERT INTO @Questions
    VALUES (1, 'Comment'), (2, 'Score')
    DECLARE @Answers TABLE (authkey INT, QuestionID INT, questiontext VARCHAR(100), answertext VARCHAR(100))
    INSERT INTO @Answers
    VALUES (101, 1, 'comment', 'hi!!'), (101, 2, 'score', '4'), (102, 1, 'comment', 'excellent'), (102, 2, 'score', '5'), (103, 2, 'score', '6'), (104, 2, 'score', '8')
    SELECT
    A.AuthKey
    ,Q.QuestionID
    ,Q.QuestionText
    ,A.AnswerText
    FROM
    @Questions Q
    INNER JOIN @Answers A ON Q.QuestionID = A.QuestionID
    UNION
    SELECT
    A.AuthKey
    ,Q.QuestionID
    ,Q.QuestionText
    ,Null
    FROM
    @Questions Q
    CROSS JOIN @Answers A
    WHERE
    NOT EXISTS (SELECT 1 FROM @Answers SubQry WHERE SubQry.AuthKey = A.AuthKey AND SubQry.QuestionID = Q.QuestionID)
    Output
    AuthKey | QuestionID
    | QuestionText
    | AnswerText
    101 | 1 | Comment | hi!!
    101 | 2 | Score | 4
    102 | 1 | Comment | excellent
    102 | 2 | Score | 5
    103 | 1 | Comment | NULL
    103 | 2 | Score | 6
    104 | 1 | Comment | NULL
    104 | 2 | Score | 8
    Best Wishes, Arbi; Please vote if you find this posting was helpful or Mark it as answered.

  • HT1527 iphone wont open it says the itunes library.itl file is locked on a locked disk or you do not have write permission for this file. nothing l  do seems to help thanks

    Have tried to connect and sync my iphone 4 to my computer in itunes but this message keeps coming up The itunes Library .itl file is locked on a locked disk. or you do not have write permission for this file.

    I have tried both suggestions, unfortunately neither fixed this for me. Hoping there's another possible fix. Thanks in advance. 
    Empty/corrupt iTunes library after upgrade/crash and/or Repair security permissions for iTunes for Windows.

  • Please provide code for this logic

    Hi,
    table
    id                    code
    145623          xyz001
    178956          sbh002
    165895          sbi003
    As per this logic,for  every new entity of id a new autogenerated code will be  generated.
    This (xyz or sbh or sbi) code should be fetched using select query (select b_code into table.code from cmp where c_id =145623)
    using id(145623). And 001,002 is autogenerated code and should be concentrated with xyz ex: xyz001
    Here we can use trigger with sequence
    Could you please help me..

    How many times you will ask same question???
    You need to use pl/sql block for your requirement   some thing like this:
    create sequence and add into pl/sql block like:
    >>Select max(count) into temp_var where id=’sbi’
    >>New_code:=’sbi’+temp_var;
    Now you need to optimize it...
    Thanks...

  • Need SQL code for this logic - -  From Serial and To serial no.

    In Forms 4.5 Screen I have two text boxes where i will be entering From Serial No
    and to serial no.
    I want the code which will check whether any number in between these from and to serial exists in a table or not ?
    For Example
    Select * from t; -- contains
    serial number
    321-456-789
    123-456-654
    321-569-986
    321-569-987
    When I enter from Serial no 321-456-789 and to serial no as 321-456-789.. I should get a message sayinig that 321-456-789 exists.
    When I enter from Serial no 321-569-986 and to serial no as 321-569-988.
    I should get a message sayinig that 321-456-986 exists.
    I should get a message sayinig that 321-456-987 exists.
    I should get a message sayinig that 321-456-988 not exists.
    is it possible with a SQL query or do we need to go for procedure or temp table ?
    If anybody ahving similar code please post it here.
    Thanks in Advance
    Devender

    Hi Devender,
    Try this :
    SQL> select * from t;
    SN
    321-456-789
    123-456-654
    321-569-986
    321-569-987
    SQL> var sn1 varchar2(11)
    SQL> exec :sn1 := '321-569-986'
    Procédure PL/SQL terminée avec succès.
    SQL> var sn2 varchar2(11)
    SQL> exec :sn2 := '321-569-988'
    Procédure PL/SQL terminée avec succès.
    SQL>1  select a.sn, decode(t.sn,null,'does not exists','already exists')
      2  from
      3  (select substr(replace(:sn1,'-','')+rownum-1,1,3)||'-'
      4        ||substr(replace(:sn1,'-','')+rownum-1,4,3)||'-'
      5        ||substr(replace(:sn1,'-','')+rownum-1,7,3) as sn
      6  from (select level
      7        from dual
      8        connect by level <= (replace(:sn2,'-','')-replace(:sn1,'-',''))+1
      9       )
    10  )a,
    11  t
    12* where a.sn=t.sn(+)
    SQL> /
    SN                            DECODE(T.SN,NUL
    321-569-986                   already exists
    321-569-987                   already exists
    321-569-988                   does not exists
    SQL> exec :sn1 := '321-456-789'
    Procédure PL/SQL terminée avec succès.
    SQL> exec :sn2 := '321-456-789'
    Procédure PL/SQL terminée avec succès.
    SQL> l
      1  select a.sn, decode(t.sn,null,'does not exists','already exists')
      2  from
      3  (select substr(replace(:sn1,'-','')+rownum-1,1,3)||'-'
      4        ||substr(replace(:sn1,'-','')+rownum-1,4,3)||'-'
      5        ||substr(replace(:sn1,'-','')+rownum-1,7,3) as sn
      6  from (select level
      7        from dual
      8        connect by level <= (replace(:sn2,'-','')-replace(:sn1,'-',''))+1
      9       )
    10  )a,
    11  t
    12* where a.sn=t.sn(+)
    SQL> /
    SN                            DECODE(T.SN,NUL
    321-456-789                   already exists
    SQL> Nicolas.

  • How to write query for this scenario

    Hi - 
    I have two table like this: 
    Question: 
    questionid  questiontext
    1 comment
    2 score
    Answer:
    authkey  questionid
    questiontext answertext
    101 1 comment hi!!
    101 2 score 4
    102 1 comment excellent
    102 2 score 5
    103 2 score 6
    104 2 score 8
    Here there are  two question (score and comment) and answer is stored in answer table. there are case when there is no comment and only answer. but answer would always be there in answer table for each authkey. 
    I want to write the query that gives the result that if no comment is given for authkey then return null as answer. something like below: 
    Desired Result: 
    authkey questionid questiontext
    answertext
    101 1 comment hi!!
    101 2 score 4
    102 1 comment excellent
    102 2 score 5
    103 2 score 6
    103 1 comment null
    104 2 score 8
    104 1 comment null
    what query can i write to get the above desired result. 
    Thanks in advance

    Try below solution, it is NOT best solution but might work:
    Declare @Questions TABLE (QuestionID INT, QuestionText Varchar(100))
    INSERT INTO @Questions
    VALUES (1, 'Comment'), (2, 'Score')
    DECLARE @Answers TABLE (authkey INT, QuestionID INT, questiontext VARCHAR(100), answertext VARCHAR(100))
    INSERT INTO @Answers
    VALUES (101, 1, 'comment', 'hi!!'), (101, 2, 'score', '4'), (102, 1, 'comment', 'excellent'), (102, 2, 'score', '5'), (103, 2, 'score', '6'), (104, 2, 'score', '8')
    SELECT
    A.AuthKey
    ,Q.QuestionID
    ,Q.QuestionText
    ,A.AnswerText
    FROM
    @Questions Q
    INNER JOIN @Answers A ON Q.QuestionID = A.QuestionID
    UNION
    SELECT
    A.AuthKey
    ,Q.QuestionID
    ,Q.QuestionText
    ,Null
    FROM
    @Questions Q
    CROSS JOIN @Answers A
    WHERE
    NOT EXISTS (SELECT 1 FROM @Answers SubQry WHERE SubQry.AuthKey = A.AuthKey AND SubQry.QuestionID = Q.QuestionID)
    Output
    AuthKey | QuestionID
    | QuestionText
    | AnswerText
    101 | 1 | Comment | hi!!
    101 | 2 | Score | 4
    102 | 1 | Comment | excellent
    102 | 2 | Score | 5
    103 | 1 | Comment | NULL
    103 | 2 | Score | 6
    104 | 1 | Comment | NULL
    104 | 2 | Score | 8
    Best Wishes, Arbi; Please vote if you find this posting was helpful or Mark it as answered.

  • How to write code for outbound proxy

    hi all,
    i /people/ravikumar.allampallam/blog/2005/03/14/abap-proxies-in-xiclient-proxy
    ied the link for outbound code i got it but i want to get data for multiple values. what changes i need to do in that.
    Moderator message : Duplicate post locked.
    Edited by: Vinod Kumar on Sep 26, 2011 4:09 PM

    Hi Satya,
    I am working on ABAP HR. Currently i am working on supporting project.
    I had done many interfaces. But still i am not confident on interfaces.
    Currently i don't have requirement, i want general explanation about outbound and inbound interface processing.
    If you have free time, please explain to me.
    Cheers,
    Guru.

  • How to write SQL for this query

    Hi, All
    I have table which sample data are shown below
    CLM_NO. CLM_RUN PARTY PAY_CD
    2006213103246      2006085483      PA010193 3CO11
    2006213103246      2006085483 PA010193 3CO17
    2006213103246      0000000000 PA084113 2CO11
    2006213103246      0000000000 PA000001 2RK11
    2006213103246      0000000000 PA082822 3CO11
    2006213103270      0000000000 PA000001 2RK11
    2006213103270      0000000000 PA032456 3CO11
    for each clm_no , if data only have zero the report must show pay_cd minimum value(2RK11) but when clm_run have both zero and nonzero data the report will show minimum pay_cd of record that have clm_run nonzero data(3CO11)
    Thank you
    Mcka

    Hi Mcka
    Based on the example you have provided, we should have only the following two rows in the final result:
    CLM_NO. CLM_RUN PARTY PAY_CD
    2006213103246 2006085483 PA010193 3CO11
    2006213103270 0000000000 PA000001 2RK11
    The first line is displayed because even though there are 6 rows for CLM_NO 2006213103246, with a combination of zero and non-zero CLM_RUNS, we need to display the non-zero row containing the minimum PAY_CD.
    The second line is displayed because both rows have a zero CLM_RUN and we need to display the row which has the lowest PAY_CD.
    If this understanding sounds right to you then you need to create the following condition:
    RANK() OVER(PARTITION BY CLM_NO ORDER BY CLM_RUN DESC, PAY_CD ASC) = 1
    Can you follow what this is doing?
    Basically, for each CLM_NO, identified by the clause PARTITION BY CLM_NO, we are ranking the combination of CLM_RUN and PAY_CD where the CLM_RUN is sorted in high to low order and the PAY_CD is sorted in low to high order. This will cause Discoverer to allocate an ascending range of numbers starting with 1, where 1 corresponds to the row you are looking for. If we create a condition such that this whole expression equals 1 then we must display only the rows that you want, with one row being displayed per CLM_NO.
    Note: This works so long as the same CLM_NO cannot have two or more different CLM_RUN numbers where one of the higher CLM_RUNs has a lower PAY_CD than the other non-zero CLM_RUNs.
    It also makes the assumption that for a given non-zero CLM_RUN there will not be two or more identical PAY_CDs. If this condition can exist then you could exclude duplicate values from the report. If you have never done this there is a checkbox called Hide Duplicate Rows on the Layout tab of the Edit Worksheet Dialog box.
    Best wishes
    Michael

Maybe you are looking for

  • How to delete Bulk Email Folder in ios8

    With the IOS8 upgrade I'm seeing a Bulk email folder, which downloads ALL of my spam from my AT&T server if I mistakenly tap it. Thenit takes me an hour or so to manually remove each of the emails one by one. What a PAIN!  Then I'm seeing an extra Tr

  • How to use a ECC6 ztable in SAP BI without create a SAP BI flow (DSO)

    Hi, We have a specific parameters table ZTABLE  in ECC6 to maitain a factory date, this table is updated via an ABAP program (ZPROGRAM) after a factory job. The ZTABLE contain one a field u201CZDATEu201D that we need to store it into the infocube for

  • Restore default isolation level fails with connection in pool

    Hi, I am developing an application that needs to set the TransactionIsolation to SERIALIZE for a transaction. Setting the TransactionIsolation is not the problem. After this transaction is committed or rolled back, i set the isolation level back to t

  • Temp tables and dml commit

    I need to create a temporary table that is transaction oriented (not session), insert data into it, and read the data. Apparently, each xsql:dml implies a commit. I cannot use "Preserve rows" (session related) in my table definition, and each commit

  • System crashes after mountain lion install

    I installed Mountain Lion this weekend and my 2008 iMac has crashed twice with the following messages logged: 2012-07-30 17:44:05 -0700 coresymbolicationd[351]: /Library/Caches/com.apple.coresymbolicationd/data did not validate, resetting cache 2012-