UDF Req: urgent

Hi All
i am begineer in the XI kindly help me with this UDF.
i am checking the value of the field1 = ### then target root node should be created.
if field1 == ###
i dont want to map to the target root node
else
i want to send the value to the root node
this is mu UDF
//write your code here
for(int i=0;i< field.length;i++)
if(field<i>.equalsIgnoreCase("###"))
result.addValue(ResultList.SUPPRESS);
else
result.addValue("true");
this is not working, only else part is working for all inputs

i am doing with the create if but it is not working properly......
Source:                               target:
Root1                                 Root 0-un
  IDOC                                Field1
  Subroot1                           Field2
  SubRoot2                                
    Field1ofSubroot2
if field1ofSubroot Exists and if value is 04501 then target root node should create
if i use createif to tagret root node
if my input values to field are
0000
0450
then no Output is genereated because 1st value is failed (context of Field1OfSubroot2 is
Subroot2)
if i change the context of Field1OfSubroot2 is to IDOC then only row is created for the values of 000, on the root node if i check the queue (1st is supressed and 2nd is true)
instead of sending the details of 0450 it is sending the details of 000....
kindly help

Similar Messages

  • UDF req for mapping

    Scenario IDoc to File:
    For one filed I get different values. As many as 20 values from sap and for that value I will have to set an error code. Each Number from SAP will have an error code respectively.
    Thanks
    Kiran

    Hi Kiran
    Yes, you are right we will need to import in archive folder as JAR
    Steps>
    >First Make a java class containing your method or any number of other method
    like
    public class TextOne {
         public static void main(String[] args) {
         public String yourMethodName(String parameter){
            String result = "your value"; // as for example
              return result;
    >step continue
    >go to command prompt
    > go to directory(package name like in above code) where u r java file is there
    >make jar by following command
    >jar -cvf nameofjarfile.jar yourjavafilename.java
    >nameofjarfile.jar will we created
    >go to archive folder in IR
    >import that jar file
    >go to UDF
    >write import packagename
    >now u can access function like class's object.method name
    Reward points if helpful

  • Asset aquisition report help req (urgent)

    hi  all,
    in my following code there is a problem ie i am not getting all line items from
    table ANLC & ANEK.
    check the query whether there is any problem in the loop or query .
    send me the modification for that or otherwise if u have devloped the code
    for asset aquisition then send me that to my id- [email protected]
    Report Z_FA_ACQ  NO STANDARD PAGE HEADING
                     LINE-SIZE 400
                     LINE-COUNT 65(3).
    TYPE-POOLS : SLIS.
    TABLES : ANLA,                     "ASSET MASTER RECORD-SEGMENT
             ANLZ.                     "time dependent asset allocations
    DATA : BEGIN OF T_ANLA OCCURS 0,
           BUKRS LIKE ANLA-BUKRS,
           ANLN1 LIKE ANLA-ANLN1,
           ANLN2 LIKE ANLA-ANLN2,
           AKTIV LIKE ANLA-AKTIV,
           TXT50 LIKE ANLA-TXT50,
           ZUGDT LIKE ANLA-ZUGDT,
           MENGE LIKE ANLA-MENGE,
           MEINS LIKE ANLA-MEINS,
           END OF T_ANLA.
    DATA : BEGIN OF T_ANLZ OCCURS 0,
           BUKRS LIKE ANLZ-BUKRS,
           ANLN1 LIKE ANLZ-ANLN1,
           ANLN2 LIKE ANLZ-ANLN2,
           GSBER LIKE ANLZ-GSBER,
           KOSTL LIKE ANLZ-KOSTL,
           STORT LIKE ANLZ-STORT,
           RAUMN LIKE ANLZ-RAUMN,
           KFZKZ LIKE ANLZ-KFZKZ,
           END OF T_ANLZ.
    DATA : BEGIN OF T_ANEK OCCURS 0,
           BUKRS LIKE ANEK-BUKRS,
           ANLN1 LIKE ANEK-ANLN1,
           ANLN2 LIKE ANEK-ANLN2,
           BELNR LIKE ANEK-BELNR,
           BUDAT LIKE ANEK-BUDAT,
           XBLNR LIKE ANEK-XBLNR,
           SGTXT LIKE ANEK-SGTXT,
           END OF T_ANEK.
    DATA : BEGIN OF T_ANLC OCCURS 0,
           BUKRS LIKE ANLC-BUKRS,
           ANLN1 LIKE ANLC-ANLN1,
           ANLN2 LIKE ANLC-ANLN2,
           KANSW LIKE ANLC-KANSW,
           KNAFA LIKE ANLC-KNAFA,
           AAFAP LIKE ANLC-AAFAP,
           AFABE LIKE ANLC-AFABE,
           GJAHR LIKE ANLC-GJAHR,
           END OF T_ANLC.
    DATA : BEGIN OF IT_FINAL OCCURS 0,
            ANLN1 LIKE ANLA-ANLN1,
            ANLN2 LIKE ANLA-ANLN2,
            AKTIV LIKE ANLA-AKTIV,
            TXT50 LIKE ANLA-TXT50,
            ZUGDT LIKE ANLA-ZUGDT,
            MENGE LIKE ANLA-MENGE,
            MEINS LIKE ANLA-MEINS,
            GSBER LIKE ANLZ-GSBER,
            KOSTL LIKE ANLZ-KOSTL,
            STORT LIKE ANLZ-STORT,
            RAUMN LIKE ANLZ-RAUMN,
            KFZKZ LIKE ANLZ-KFZKZ,
            BELNR LIKE ANEK-BELNR,
            BUDAT LIKE ANEK-BUDAT,
            XBLNR LIKE ANEK-XBLNR,
            SGTXT LIKE ANEK-SGTXT,
            KANSW LIKE ANLC-KANSW,
            KNAFA LIKE ANLC-KNAFA,
            AAFAP LIKE ANLC-AAFAP,
            GJAHR LIKE ANEK-GJAHR,
            END OF IT_FINAL.
    DATA : LINE_COLOR(4) TYPE C.
    DATA : FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
           GD_LAYOUT TYPE SLIS_LAYOUT_ALV.
    SELECTION-SCREEN : BEGIN OF BLOCK B_FA WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS : S_BUKRS FOR ANLA-BUKRS DEFAULT 'ML',
                     S_ANLN1 FOR ANLA-ANLN1,
                     S_ANLN2 FOR ANLA-ANLN2.
                    s_gjahr FOR anlc-gjahr.
    SELECTION-SCREEN : END OF BLOCK B_FA.
    *SELECT-OPTIONS : s_belnr FOR anek-belnr.
    SELECT BUKRS ANLN1 ANLN2 AKTIV TXT50 ZUGDT MENGE MEINS
           FROM ANLA
           INTO CORRESPONDING FIELDS OF TABLE T_ANLA
           WHERE ANLN1 IN S_ANLN1
           AND   ANLN2 IN S_ANLN2
           AND   BUKRS IN S_BUKRS.
    SELECT BUKRS ANLN1 ANLN2 GSBER KOSTL STORT RAUMN KFZKZ
           FROM ANLZ
           INTO CORRESPONDING FIELDS OF TABLE T_ANLZ
           FOR ALL ENTRIES IN T_ANLA
           WHERE ANLN1 = T_ANLA-ANLN1
           AND   ANLN2 = T_ANLA-ANLN2
           AND   BUKRS = T_ANLA-BUKRS.
    *IF sy-subrc EQ 0.
    SELECT BUKRS ANLN1 ANLN2 BELNR BUDAT XBLNR SGTXT GJAHR
           FROM ANEK
           INTO CORRESPONDING FIELDS OF TABLE T_ANEK
           FOR ALL ENTRIES IN T_ANLA
           WHERE ANLN1 = T_ANLA-ANLN1
           AND   ANLN2 = T_ANLA-ANLN2
           AND   BUKRS = T_ANLA-BUKRS.
          AND   gjahr = t_anek-gjahr.
    *ENDIF.
    SELECT BUKRS ANLN1 ANLN2 KANSW KNAFA AAFAP AFABE GJAHR
           FROM ANLC
           INTO CORRESPONDING FIELDS OF TABLE T_ANLC
           FOR ALL ENTRIES IN T_ANLA
           WHERE ANLN1 = T_ANLA-ANLN1
           AND   ANLN2 = T_ANLA-ANLN2
           AND   BUKRS = T_ANLA-BUKRS
           AND   GJAHR = T_ANLC-GJAHR.
          AND   afabe = '01'.
    LOOP AT T_ANLA.
      MOVE : T_ANLA-ANLN1 TO IT_FINAL-ANLN1,
             T_ANLA-ANLN2 TO IT_FINAL-ANLN2,
             T_ANLA-AKTIV TO IT_FINAL-AKTIV,
             T_ANLA-TXT50 TO IT_FINAL-TXT50,
             T_ANLA-ZUGDT TO IT_FINAL-ZUGDT,
             T_ANLA-MENGE TO IT_FINAL-MENGE,
             T_ANLA-MEINS TO IT_FINAL-MEINS.
    READ TABLE T_ANLZ WITH KEY BUKRS = T_ANLA-BUKRS
                               ANLN1 = T_ANLA-ANLN1
                               ANLN2 = T_ANLA-ANLN2 BINARY SEARCH.
    IF SY-SUBRC EQ 0.
    MOVE : T_ANLZ-GSBER TO IT_FINAL-GSBER,
            T_ANLZ-KOSTL TO IT_FINAL-KOSTL,
            T_ANLZ-STORT TO IT_FINAL-STORT,
            T_ANLZ-RAUMN TO IT_FINAL-RAUMN,
            T_ANLZ-KFZKZ TO IT_FINAL-KFZKZ.
    ENDIF.
    READ TABLE T_ANLC WITH KEY BUKRS = T_ANLA-BUKRS
                               ANLN1 = T_ANLA-ANLN1
                               ANLN2 = T_ANLA-ANLN2 BINARY SEARCH.
    IF SY-SUBRC EQ 0.
    MOVE : T_ANLC-KANSW TO IT_FINAL-KANSW,
            T_ANLC-KNAFA TO IT_FINAL-KNAFA,
            T_ANLC-AAFAP TO IT_FINAL-AAFAP.
    ENDIF.
    *SORT t_anla.
    READ TABLE T_ANEK WITH KEY BUKRS = T_ANLA-BUKRS
                               ANLN1 = T_ANLA-ANLN1
                               ANLN2 = T_ANLA-ANLN2 BINARY SEARCH.
    IF SY-SUBRC EQ 0.
    MOVE : T_ANEK-BELNR TO IT_FINAL-BELNR,
            T_ANEK-BUDAT TO IT_FINAL-BUDAT,
            T_ANEK-XBLNR TO IT_FINAL-XBLNR,
            T_ANEK-SGTXT TO IT_FINAL-SGTXT.
    ENDIF.
    APPEND IT_FINAL.
    *ENDLOOP.
    ENDLOOP.
    *ENDIF.
    PERFORM BUILD_FIELDCATALOG.
    PERFORM DISPLAY_ALV_REPORT.
    PERFORM BUILD_LAYOUT.
          FORM BUILD_FIELDCATALOG                                       *
    FORM BUILD_FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'ANLN1'.
      FIELDCATALOG-SELTEXT_M = 'ASSET MAIN NO'.
      FIELDCATALOG-COL_POS   = 0.
      FIELDCATALOG-OUTPUTLEN = 14.
      FIELDCATALOG-EMPHASIZE = 'X'.
      FIELDCATALOG-KEY       = 'X'.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'ANLN2'.
      FIELDCATALOG-SELTEXT_M = 'SUB NO'.
      FIELDCATALOG-COL_POS   = 1.
      FIELDCATALOG-OUTPUTLEN = 7.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'AKTIV'.
      FIELDCATALOG-SELTEXT_M = 'CAP.DATE'.
      FIELDCATALOG-COL_POS   = 2.
      FIELDCATALOG-OUTPUTLEN = 10.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'TXT50'.
      FIELDCATALOG-SELTEXT_M = 'NAME'.
      FIELDCATALOG-COL_POS   = 3.
      FIELDCATALOG-OUTPUTLEN = 50.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'ZUGDT'.
      FIELDCATALOG-SELTEXT_M = 'POSTING DATE'.
      FIELDCATALOG-COL_POS   = 4.
      FIELDCATALOG-OUTPUTLEN = 10.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'MENGE'.
      FIELDCATALOG-SELTEXT_M = 'QTY'.
      FIELDCATALOG-COL_POS   = 5.
      FIELDCATALOG-OUTPUTLEN = 13.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'MEINS'.
      FIELDCATALOG-SELTEXT_M = 'UNITS'.
      FIELDCATALOG-COL_POS   = 6.
      FIELDCATALOG-OUTPUTLEN = 3.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
    FIELDCATALOG-FIELDNAME = 'GSBER'.
    FIELDCATALOG-SELTEXT_M = 'BA'.
    FIELDCATALOG-COL_POS   = 7.
    FIELDCATALOG-OUTPUTLEN = 4.
    APPEND FIELDCATALOG TO FIELDCATALOG.
    CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'KOSTL'.
      FIELDCATALOG-SELTEXT_M = 'COST CENTER'.
      FIELDCATALOG-COL_POS   = 8.
      FIELDCATALOG-OUTPUTLEN = 13.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'STORT'.
      FIELDCATALOG-SELTEXT_M = 'LOCATION'.
      FIELDCATALOG-COL_POS   = 9.
      FIELDCATALOG-OUTPUTLEN = 10.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'RAUMN'.
      FIELDCATALOG-SELTEXT_M = 'ROOM'.
      FIELDCATALOG-COL_POS   = 10.
      FIELDCATALOG-OUTPUTLEN = 10.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'KFZKZ'.
      FIELDCATALOG-SELTEXT_M = 'LICENSE PLATE NO'.
      FIELDCATALOG-COL_POS   = 11.
      FIELDCATALOG-OUTPUTLEN = 20.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME = 'BELNR'.
      FIELDCATALOG-SELTEXT_M = 'DOC NO'.
      FIELDCATALOG-COL_POS   = 12.
      FIELDCATALOG-OUTPUTLEN = 13.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR FIELDCATALOG.
       FIELDCATALOG-FIELDNAME = 'BUDAT'.
       FIELDCATALOG-SELTEXT_M = 'POSTING DATE'.
       FIELDCATALOG-COL_POS   = 13.
       FIELDCATALOG-OUTPUTLEN = 15.
       APPEND FIELDCATALOG TO FIELDCATALOG.
       CLEAR FIELDCATALOG.
       FIELDCATALOG-FIELDNAME = 'XBLNR'.
       FIELDCATALOG-SELTEXT_M = 'REF NO'.
       FIELDCATALOG-COL_POS   = 14.
       FIELDCATALOG-OUTPUTLEN = 25.
       APPEND FIELDCATALOG TO FIELDCATALOG.
       CLEAR FIELDCATALOG.
       FIELDCATALOG-FIELDNAME = 'SGTXT'.
       FIELDCATALOG-SELTEXT_M = 'TEXT'.
       FIELDCATALOG-COL_POS   = 15.
       FIELDCATALOG-OUTPUTLEN = 50.
       APPEND FIELDCATALOG TO FIELDCATALOG.
       CLEAR FIELDCATALOG.
    ENDFORM.
          FORM BUILD_LAYOUT                                             *
    FORM BUILD_LAYOUT.
    GD_LAYOUT-ZEBRA = 'X'.
    GD_LAYOUT-INFO_FIELDNAME = 'LINE_COLOR'.
    ENDFORM.
          FORM DISPLAY_ALV_REPORT                                       *
    FORM DISPLAY_ALV_REPORT.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
          EXPORTING
            I_INTERFACE_CHECK        = ' '
            I_CALLBACK_PROGRAM       = ' '
            I_CALLBACK_PF_STATUS_SET = ' '
            I_CALLBACK_USER_COMMAND  = ' '
            I_STRUCTURE_NAME         =
             IS_LAYOUT                = GD_LAYOUT
               IT_FIELDCAT              = FIELDCATALOG[]
            IT_EXCLUDING             =
            IT_SPECIAL_GROUPS        =
            IT_SORT                  =
            IT_FILTER                =
            IS_SEL_HIDE              =
            I_DEFAULT                = 'X'
            I_SAVE                   = ' '
            IS_VARIANT               = ' '
            IT_EVENTS                =
            IT_EVENT_EXIT            =
            IS_PRINT                 =
            I_SCREEN_START_COLUMN    = 0
            I_SCREEN_START_LINE      = 0
            I_SCREEN_END_COLUMN      = 0
            I_SCREEN_END_LINE        = 0
       IMPORTING
            E_EXIT_CAUSED_BY_CALLER  =
            ES_EXIT_CAUSED_BY_USER   =
           TABLES
                T_OUTTAB                 = IT_FINAL
           EXCEPTIONS
                PROGRAM_ERROR            = 1
                OTHERS                   = 2.
    ENDFORM.

    Hi Sanjeev,
    I found out one small error in your code.  While fetching from ANLC table
    SELECT bukrs anln1 anln2 kansw knafa aafap afabe gjahr
    FROM anlc
    INTO CORRESPONDING FIELDS OF TABLE t_anlc
    FOR ALL ENTRIES IN t_anla
    WHERE anln1 = t_anla-anln1
    AND anln2 = t_anla-anln2
    AND bukrs = t_anla-bukrs
    AND gjahr = t_anlc-gjahr.
    <b>gjajr = t_anlc-gjahr</b>: here if you are fetching data into <b>t_anlc</b> for the first time, then how can you use it for selection also? this is my question. I commented and executed and i got the records fetched from ANLC table.

  • FM  Help Req urgent

    hi all ,
    i have to create a FM in which input parameter
    should be
    DOC DATE- ____________  to ______________________
    means it should take input date in ranges
    ex- 01.05.2007 to 31.05.2007
    so how should i proceed for this.
    Thanks
    Sanjeev

    Hi,
    if you do have only one intervall I would use two different exporting parameters like
    DATE_FROM
    DATE_TO
    if it is a real range use it via TABLES
    TABLES
      EX_RANGE = [range]

  • UDF in message mapping instead of Java Mapping. Pls advice urgent

    Hi All,
    My scenario
    CRM --- XI -- CRM
    In XI I have to open socket connection.
    Pls refer link:
    /people/saravanakumar.kuppusamy2/blog/2005/12/15/socket-integration-with-xi
    Can Java Mapping code given in above link for socket connection can be used in Message Mapping (CRM -- CRM)UDF?
    Pls advice urgent
    Regards

    Hi Henry,
    I understood your requirement.
    But as per the architecture of XI/PI some message has to trigger your scenario.
    In this case there is no adapter where you can directly communicate with CRM system.
    Do one thing configure a dummy scenario on the sender side.
    Use File adapter for simplicity. once it pools the file with some dummy data in the file it comes to Interface mapping(message mapping) of the PIPELINE steps. Now use the code as you mentioned above(within UDF) for opening socket to CRM system and implement you business logic within that program and write the response to target interface which will infact talk with CRM system.
    Dont forget to do the coding in an infinite loop with some delay (if required). Other wise every time you have to put a message for File Adapter for triggering purposes.
    You can also acheive the same if you use Java Mapping instead of Graphical mapping with UDF(code for Opening socket and business logic). I suggest you to use Java Mapping.
    I dont know how you will comunicate with CRM system on receiver side.?
    Thanks,
    Gujjeti

  • User Defined Function (UDF) help required. Pls advice urgent.

    Hi ,
    CRM -- XI (UDF) -- Socket Connection
    Now in User Defined Function (UDF) of Message Mapping I will open Socket Connection.
    Send CRM XML request to socket and get XML response from Socket and then map to some system.
    Can I write Java Class code in User Defined Function (UDF)  of Message Mapping instead of Java Mapping in blog below?
    /people/saravanakumar.kuppusamy2/blog/2005/12/15/socket-integration-with-xi
    Regards

    Henry,
    Do you have a structure for your response...if you do then you can do extended reciever det with sync/async..shouldent matter, i just tried it and i dont get any error.
    in your reciever determination..Check the box for standard rec det then add your first condition..of the value of a field to true..then send to A..
    then you select add condition..and add for second reciever..that should be it, you shouldent need a bpm for such a simple scenario..it definetly is an overkill.
    Regards
    Ravi Raman

  • Problem in Invoice correction Req. (supplimentary invoice) - urgent

    Dear friends,
    When i create invoice request (RK), I am getting two line item in order. One is related to G2N item category and another one is L2N item category. G2N is showing -value and L2n is showing +value.
    Here my query is, I had invoice request plant wise, ex. Plant A had zrk and plant B had zrs order types. In plant A order have both the item categories G2n and L2N are + values and Plant B have G2N is u2013 value and L2N is +value.
    Please guide me gurus, what is functionality of G2N and L2N item categories, if G2N is + value what is the impact on sales and customer balance.
    Please tell step by steps itu2019s very urgent for me.
    Advanced thanks
    Regards
    Es.

    Then no need to go for g2n item category or something else.........
    Supplementary Invoice Process
    Copy the document type BV, Item cat BVN please take schedule line cat CT which implicates not relevant for picking.
    Process is
    Create Sales Order - Delivery (Not picking any Qty) do PGI - Create Delivery related Billing.......
    If u find any difficulty please lemme know so that i can guide u better.
    Jay

  • Mapping Issue(UDF) in HTTP-RFC scenario with URL parameters - Urgent

    Hi All,
    I am working out an HTTP-RFC scenarion wherein there is no xml data to be pushed.
    The data will be coming in the url parameters.
    Also we'll exposing our url(created by SAP PI) to 3rd party system to push data in terms of url parameters.
    So how do I do mapping? Also what UDF code will contain?
    Since I'm working on this kind of scenario for the first time, I need every help from you guys.
    Thanks & Regards,
    Amit Patil

    Hi All,
    I have worked on RFC to HTTP scenario wherein URL have to be passed. I used UDF in d same.
    But now the case is reverse, how shall I move ahead with what source message type(in the mapping) and how to do mapping.
    What kind of UDF will be useful here?
    I am completely blank in this kind of scenario where 3rd party system is going to pass four parameters on URL link craeted by us since its an HTTP to RFC scenario.
    Please guys help me! Give me some inputs.
    Thanks,
    Amit Patil

  • Null Values(Urgent Req)

    Hi Guys,
    I have a date column where I use Max(Date) function...
    As per the req I have changed the Date format to MMM-dd-YYYY from mm-dd-yyyy...
    Now I want to display "No Date" when ever the data value is null....
    I tried writing a case statement by casting the max(date) to char...but it shows MMM-dd-YYY instead of "No Date"
    Case when cast(max(date) as char) IS NULL then 'No Date' Else cast(max(date) as char) end;
    Can some one please let me know how this can be resolved?
    Thanks in advance...

    When you changed the format to CHAR in Criteria mode, a null value will display the format syntax since the column is now CHAR. So what you want now is a CASE statement that changes 'MMM-dd-YYYY' to 'No Date.'
    Try writing the CASE statement like this:
    CASE WHEN CAST(MAX(DATE) AS CHAR) IS 'MMM-dd-YYYY' THEN 'No Date' ELSE Max(Date) END
    Tell me if this works. I'm at home and can't test it.

  • UDF: Mapping query-------Urgent

    hi...
    I m doing a scenario from File to JDBC. I have the following requirement.
    Source:
    Field1
    Field2
    On the target side i should be able to insert into database such that in column FIELD i get:
    Field1
    Field2
    This new line can be incorporated by concatenating Field1 with '|| chr(10) ||'
    which is used in Oracle for inserting a new line.
    But now i am facing a problem. The database is treating '|| chr(10) ||' as a string and instead of getting Field2 on a new line i am getting the inserted row as:
    Field1 || chr(10) || Field2.
    Please help me resolve this.

    Hi,
    A simple solution this is to write an UDF.
    You can write a code in UDF as below
    Pass a as an argument.
    String c;
    c = a + "\n"
    return c;
    use this c as variable in query.
    Regards,
    Akshay Jamgaonkar.
    Reward points if find useful.

  • Inner Join help req??Urgent!!!!!!!!!!!!!!!

    I had written the below qery : its showing error that:for pooled tble,cluster tble,projection veiws join is not allowd : 'CDPOS'.
      SELECT ekkoebeln cdhdrudate cdhdrtcode cdhdrtabname INTO CORRESPONDING FIELDS OF TABLE it_cdhdr
      FROM ( ( ekko AS ekko INNER JOIN cdhdr AS cdhdr  ON ekkoebeln = cdhdrobjectid )
                            INNER JOIN cdpos AS cdpos  ON ekkoebeln = cdposobjectid )
                WHERE ekko~ebeln = i_ebeln      AND
                      ekko~frgke EQ 'R'         AND
                      ekko~procstat EQ '05'     AND
                      cdhdr~tcode    IN ('ME29N' , 'ME28') AND
                      cdpos~tabname  = 'EKKO'
                      GROUP BY     ekko~ebeln
                                   ekko~frgke
                                   ekko~procstat
                                   cdhdr~udate
                                   cdhdr~tcode
                                   cdpos~tabname.
    so what shd i do,i need this table for the fetching data.
    Plz tell me any way to solve this......its Urgent!!!!!!!!!!!!!!!!!!
    Regards
    Vipin

    Hi Vipin,
    U can't perform JOIN with Pooled or Cluster tables
    And U can use only Internal table after FOR ALL ENTRIES <internal table>
    Try to store whole data of CDPOS in the internal table and then use it..
    See below links to get idea on how to work with cluster and pooled tables...
    trying to join A018 and KONP .... here A018 is Pooled table... Look at below threads...
    Re: abap query join A018/KONP
    Can't perform join table
    Hope it will solve your problem..
    <b>Reward points if useful.</b>
    Thanks & Regards
    ilesh 24x7

  • Req for UDF

    Hi All,
    In Mapping I have to check for a field, ie if the field has value i need to pass it to target or else need to throw error.
    mapping is  X (1) --->  Y (0..1) , X is coming from CSV file , if i give blank in the file its processign , but it should throw error.
    Do i need to write UDF or can i do it using graphical mapping..
    Thanks ,
    Monish.

    use this UDF
    if(a.equals(""))
    throw new RuntimeException("Empty input");
    else return a;
    use mapping
    Sourcefield---.UDF--->TargetField
    Check this blog also
    [/people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping
    Edited by: Kubra fatima on Jul 9, 2009 9:33 AM

  • Urgent : req still running

    hello,
    i had strucked at ,one of ODS is uploading to three cubes ..where the req is still running the message is given as
    It is possible that data packets must be processed manually.
    error in inbox
    00397 IDocs searched through for date 06.12.2006.
    00006 of the IDocs belonged to this request.
    00006 IDocs found for this request up until now.
    regds
    SP

    Hi,
    Need more inputs,
    Let us know what is the technical status in the monitor screen for upload?
    (the one status below the QM status). If it shows processing...then wait till you get some error.
    <u>Other options:</u>
    check the job log in SM37 for the running upload.
    If the job has finished check at what stage the load is running.
    Check if source system is working fine.
    Regards,
    Vijay.

  • Urgent interesting req

    Hi friends ,
    i have a req like this the I_BSID int table is having records like this
    year/month posting dt assignmnet amount in loccurrency
    opening balance as that of 04/01/2007 is last month end balance i.e march           0.00
    2007/04     2007/04/03 ar0r             15020.23
    2007/04     2007/04/07 0110                            125.32-
                      sub total                      15020.23    125.32
    closing balance             = open + ( 15020.23 + 125.23- )            
    Here i don;t have data for say month 05
    could you let me know how to update z table from month 05
    below logic is working for month 04 but not for 05 as the int table is not having values for month 05
    Kindly let me know how to update  z table for month 05 so that to get cumulative balance
         closed open balance
    apr 1500   1000 500
    may 0.00    0.00 500 ( pre apr balance + (0.00-0.00)
    Kindly let me know how to do it.
    LOOP AT i_bsid.
          wa_bsid = i_bsid.
          IF wa_bsid-shkzg = 'S'.
            z_newitems = wa_bsid-dmbtr + z_newitems.
          ELSE.
            wa_bsid-dmbtr = 0 - wa_bsid-dmbtr.
            z_closeditems = wa_bsid-dmbtr + z_closeditems.
          ENDIF.
          AT END OF budat+4(2).
            CONCATENATE wa_bsid-budat0(4) wa_bsid-budat4(2) INTO v_spmon.
            i_ztable-mandt      = sy-mandt.
            i_ztable-spmon      = v_spmon.( year / month )
            i_ztablekunnr      = wa_bsid-kunnr.
            i_ztable-bukrs      = wa_bsid-bukrs.
            i_z-tablez_newitems = z_newitems.
            i_z-z_closeditems = z_closeditems.
            i_z-z_balance = z_newitems + z_closeditems.
            APPEND i_ztable.
            CLEAR: z_newitems,z_closeditems.

    At end of the internal table, after you update month 04 - you need to calculate how many months left to update. Just use Do statement to calculate and add to internal table.

  • Urgent help req : work item id not getting passed in the method

    Hi ,
    I have created a subtype zcats of business object CATS and delegated it .
    I have created a new method Approve1 ( with attributes  SYNCRONUS & DIALOG )  in zcats which is similar in coding  to Approve method of CATS ( DIALOG) .
    I have include the method Approve1 of business object zcats in a standard task .
    The problem is that when the eorkflow gets triggered ,  the workitem id is not getting passed in the method APProve1 of zcats.
    Can someone please help me with this .
    Points would surely be awarded .

    BEGIN_METHOD APPROVE1 CHANGING CONTAINER.                 
      DATA: WORKITEMID_IMP LIKE OBJECT-KEY-ITEMID.              
      DATA: WI_CHCKWI LIKE SWWWIHEAD-WI_ID.                     
      DATA: WORKITEM TYPE SWC_OBJECT.                           
       <u> WORKITEMID_IMP = OBJECT-KEY-ITEMID</u>.                     
        SWC_GET_ELEMENT CONTAINER '_WORKITEM' WORKITEM.         
        SWC_GET_PROPERTY WORKITEM 'WorkitemReference' WI_CHCKWI.
        IF SY-SUBRC EQ 0 AND NOT WI_CHCKWI IS INITIAL.          
          WORKITEMID_IMP = WI_CHCKWI.                           
        ENDIF.                                                  
        CALL FUNCTION 'CATS_WF_APPROVAL'                        
          EXPORTING                                             
            WORKITEMID_IMP = WORKITEMID_IMP                     
          TABLES                                                
            CONT_IMP = CONTAINER.                               
      END_METHOD.                                               
    hi ,
    the above is the code in the method .
    At the first step of execution underlined above , the work item id is appearing blank .
    I think that the value is not passed to the container , but i am not sure og how to pass data to this conatiner

Maybe you are looking for