V.V.Urgent (Recording)

Query is
I am recording cn21 .
I need to record for activities which i am entering in Tabctrl.
When i am using for the next time more than 17 activites it is overwriting in the 17th activity.
(It is limiting to 17 only)
Wat should i do to solve this problem.
Wat are the necessary steps to come across this problem.

Hi,
u need to handle the Page Down
check this out
for xk01
report ZB5_BDC_TC no standard page heading line-size 255.
types: begin of ty_input,
       bukrs(4)  type c,
       ekorg(4) type c,
       ktokk(4) type c,
       anred(15) type c,
       name1(30) type c,
       sortl(15) type c,
       land1(3) type c,
       BANKS(3) TYPE C,
       BANKL(15) TYPE C,
       BANKN(18) TYPE C,
       akont(10) type c,
       fdgrv(10) type c,
       zterm(4) type c,                         
       waers(5) type c,
       end of ty_input,
       BEGIN OF TY_ITEM,
       bukrs(4)  type c,
       ekorg(4) type c,
       ktokk(4) type c,
       anred(15) type c,
       name1(30) type c,
       sortl(15) type c,
       land1(3) type c,
       BANKS(3) TYPE C,
       BANKL(15) TYPE C,
       BANKN(18) TYPE C,
       END OF TY_ITEM.
data: t_bdcdata type standard table of bdcdata,
      w_bdcdata type bdcdata,
      t_input type standard table of ty_input,
      t_input2 type standard table of ty_input,
      T_INPUT3 LIKE T_INPUT, "HEADER
      W_INPUT3 TYPE TY_INPUT,
      w_input type ty_input,
      g_string type string,
      t_bdcmsgcoll type standard table of bdcmsgcoll,
      w_bdcmsgcoll type bdcmsgcoll,
      T_ITEM TYPE STANDARD TABLE OF TY_ITEM,
      W_ITEM TYPE TY_ITEM,
      G_FLAG(2) TYPE N,
      G_FIELD(15),
      W_CTU_PARAMS TYPE CTU_PARAMS.
W_CTU_PARAMS-DISMODE = 'A'.
W_CTU_PARAMS-UPDMODE = 'A'.
W_CTU_PARAMS-DEFSIZE = 'X'.
parameters: p_file type IBIPPARMS-PATH.
at selection-screen on value-request for p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
  PROGRAM_NAME        = SYST-CPROG
  DYNPRO_NUMBER       = SYST-DYNNR
  FIELD_NAME          = ' '
IMPORTING
   FILE_NAME           = p_file
start-of-selection.
g_string = p_file.
CALL FUNCTION 'GUI_UPLOAD'
  EXPORTING
    FILENAME                      = g_string
   FILETYPE                      = 'ASC'
   HAS_FIELD_SEPARATOR           = 'X'
  HEADER_LENGTH                 = 0
  READ_BY_LINE                  = 'X'
  DAT_MODE                      = ' '
IMPORTING
  FILELENGTH                    =
  HEADER                        =
  TABLES
    DATA_TAB                      = t_input
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.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT T_INPUT INTO W_INPUT.
W_INPUT3-AKONT = W_INPUT-AKONT.
W_INPUT3-FDGRV = W_INPUT-FDGRV.
W_INPUT3-ZTERM = W_INPUT-ZTERM.
W_INPUT3-WAERS = W_INPUT-WAERS.
AT NEW LAND1.
W_INPUT3-BUKRS = W_INPUT-BUKRS.
W_INPUT3-EKORG = W_INPUT-EKORG.
W_INPUT3-KTOKK = W_INPUT-KTOKK.
W_INPUT3-ANRED = W_INPUT-ANRED.
W_INPUT3-NAME1 = W_INPUT-NAME1.
W_INPUT3-SORTL = W_INPUT-SORTL.
W_INPUT3-LAND1 = W_INPUT-LAND1.
APPEND W_INPUT3 TO T_INPUT3.
ENDAT.
W_ITEM-BUKRS = W_INPUT-BUKRS.
W_ITEM-EKORG = W_INPUT-EKORG.
W_ITEM-KTOKK = W_INPUT-KTOKK.
W_ITEM-ANRED = W_INPUT-ANRED.
W_ITEM-NAME1 = W_INPUT-NAME1.
W_ITEM-SORTL = W_INPUT-SORTL.
W_ITEM-LAND1 = W_INPUT-LAND1.
W_ITEM-BANKS = W_INPUT-BANKS.
W_ITEM-BANKN = W_INPUT-BANKN.
W_ITEM-BANKL = W_INPUT-BANKL.
APPEND W_ITEM TO T_ITEM.
ENDLOOP.
loop at t_input3 into w_input3.
refresh t_bdcdata.
perform bdc_dynpro      using 'SAPMF02K' '0100'.
perform bdc_field       using 'BDC_CURSOR'
                              'RF02K-KTOKK'.
perform bdc_field       using 'BDC_OKCODE'
                              '/00'.
perform bdc_field       using 'RF02K-BUKRS'
                              w_input3-bukrs.
perform bdc_field       using 'RF02K-EKORG'
                              w_input3-ekorg.
perform bdc_field       using 'RF02K-KTOKK'
                              w_input3-ktokk.
perform bdc_dynpro      using 'SAPMF02K' '0110'.
*perform bdc_field       using 'BDC_CURSOR'
                             'LFA1-LAND1'.
perform bdc_field       using 'BDC_OKCODE'
                              '/00'.
perform bdc_field       using 'LFA1-ANRED'
                              w_input3-anred.
perform bdc_field       using 'LFA1-NAME1'
                              w_input3-name1.
perform bdc_field       using 'LFA1-SORTL'
                              w_input3-sortl.
perform bdc_field       using 'LFA1-LAND1'
                              w_input3-land1.
perform bdc_dynpro      using 'SAPMF02K' '0120'.
perform bdc_field       using 'BDC_CURSOR'
                              'LFA1-KUNNR'.
perform bdc_field       using 'BDC_OKCODE'
                              '/00'.
perform bdc_dynpro      using 'SAPMF02K' '0130'.
perform bdc_field       using 'BDC_CURSOR'
                              'LFBK-BANKS(01)'.
G_FLAG = '01'.
LOOP AT T_ITEM INTO W_ITEM WHERE BUKRS = W_INPUT3-BUKRS
                             AND EKORG = W_INPUT3-EKORG
                             AND KTOKK = W_INPUT3-KTOKK
                             AND ANRED = W_INPUT3-ANRED
                             AND NAME1 = W_INPUT3-NAME1
                             AND SORTL = W_INPUT3-SORTL
                             AND LAND1 = W_INPUT3-LAND1.
CLEAR G_FIELD.
CONCATENATE 'LFBK-BANKS(' G_FLAG ')' INTO G_FIELD.
perform bdc_field       using G_FIELD
                              W_ITEM-BANKS.
CLEAR G_FIELD.
CONCATENATE 'LFBK-BANKL(' G_FLAG ')' INTO G_FIELD.
perform bdc_field       using G_FIELD
                              W_ITEM-BANKL.
CLEAR G_FIELD.
CONCATENATE 'LFBK-BANKN(' G_FLAG ')' INTO G_FIELD.
perform bdc_field       using G_FIELD
                              W_ITEM-BANKN.
<b>IF G_FLAG = '5'.
perform bdc_field       using 'BDC_OKCODE'
                              '=P+'.
perform bdc_dynpro      using 'SAPMF02K' '0130'.
perform bdc_field       using 'BDC_OKCODE'
                              '/00'.
G_FLAG = '00'.
ENDIF.</b>
G_FLAG = G_FLAG + 1.
ENDLOOP.
*perform bdc_field       using 'BDC_OKCODE'
                             '=ENTR'.
perform bdc_dynpro      using 'SAPMF02K' '0210'.
perform bdc_field       using 'BDC_CURSOR'
                              'LFB1-FDGRV'.
perform bdc_field       using 'BDC_OKCODE'
                              '/00'.
perform bdc_field       using 'LFB1-AKONT'
                              w_input-akont.
perform bdc_field       using 'LFB1-FDGRV'
                              w_input-fdgrv.
perform bdc_dynpro      using 'SAPMF02K' '0215'.
perform bdc_field       using 'BDC_CURSOR'
                              'LFB1-ZTERM'.
perform bdc_field       using 'BDC_OKCODE'
                              '/00'.
perform bdc_field       using 'LFB1-ZTERM'
                              w_input-zterm.
perform bdc_dynpro      using 'SAPMF02K' '0220'.
perform bdc_field       using 'BDC_CURSOR'
                              'LFB5-MAHNA'.
perform bdc_field       using 'BDC_OKCODE'
                              '/00'.
perform bdc_dynpro      using 'SAPMF02K' '0310'.
perform bdc_field       using 'BDC_CURSOR'
                              'LFM1-WAERS'.
perform bdc_field       using 'BDC_OKCODE'
                              '/00'.
perform bdc_field       using 'LFM1-WAERS'
                              w_input-waers.
perform bdc_dynpro      using 'SAPMF02K' '0320'.
perform bdc_field       using 'BDC_CURSOR'
                              'RF02K-LIFNR'.
perform bdc_field       using 'BDC_OKCODE'
                              '=ENTR'.
perform bdc_dynpro      using 'SAPLSPO1' '0300'.
perform bdc_field       using 'BDC_OKCODE'
                              '=YES'.
*call transaction 'XK01' using t_bdcdata mode 'A' update 'A' messages
                                                  into t_bdcmsgcoll.
CALL TRANSACTION 'XK01' USING T_BDCDATA OPTIONS FROM W_CTU_PARAMS
                              MESSAGES INTO T_BDCMSGCOLL.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
  TCODE                  = FILLER4
  POST_LOCAL             = NOVBLOCAL
  PRINTING               = NOPRINT
  SIMUBATCH              = ' '
  CTUPARAMS              = ' '
  TABLES
    DYNPROTAB              = T_BDCDATA
EXCEPTIONS
  INTERNAL_ERROR         = 1
  NOT_OPEN               = 2
  QUEUE_ERROR            = 3
  TCODE_INVALID          = 4
  PRINTING_INVALID       = 5
  POSTING_INVALID        = 6
  OTHERS                 = 7
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF SY-SUBRC <> 0.
APPEND W_INPUT TO T_INPUT2.
ENDIF.
endloop.
CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
  BIN_FILESIZE                  =
    FILENAME                      = 'C:\ERRORLOG.TXT'
   FILETYPE                      = 'ASC'
  APPEND                        = 'X'
   WRITE_FIELD_SEPARATOR         = 'X'
  HEADER                        = '00'
  TRUNC_TRAILING_BLANKS         = ' '
  WRITE_LF                      = 'X'
  COL_SELECT                    = ' '
  COL_SELECT_MASK               = ' '
  DAT_MODE                      = ' '
IMPORTING
  FILELENGTH                    =
  TABLES
    DATA_TAB                      = T_INPUT2
EXCEPTIONS
  FILE_WRITE_ERROR              = 1
  NO_BATCH                      = 2
  GUI_REFUSE_FILETRANSFER       = 3
  INVALID_TYPE                  = 4
  NO_AUTHORITY                  = 5
  UNKNOWN_ERROR                 = 6
  HEADER_NOT_ALLOWED            = 7
  SEPARATOR_NOT_ALLOWED         = 8
  FILESIZE_NOT_ALLOWED          = 9
  HEADER_TOO_LONG               = 10
  DP_ERROR_CREATE               = 11
  DP_ERROR_SEND                 = 12
  DP_ERROR_WRITE                = 13
  UNKNOWN_DP_ERROR              = 14
  ACCESS_DENIED                 = 15
  DP_OUT_OF_MEMORY              = 16
  DISK_FULL                     = 17
  DP_TIMEOUT                    = 18
  FILE_NOT_FOUND                = 19
  DATAPROVIDER_EXCEPTION        = 20
  CONTROL_FLUSH_ERROR           = 21
  OTHERS                        = 22
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
PERFORM SUB_GET_MESG.
*&      Form  bdc_dynpro
FORM bdc_dynpro  USING    VALUE(P_0024)
                          VALUE(P_0025).
clear w_bdcdata.
w_bdcdata-program = p_0024.
w_bdcdata-dynpro = p_0025.
w_bdcdata-dynbegin = 'X'.
append w_bdcdata to t_bdcdata.
ENDFORM.                    " bdc_dynpro
*&      Form  bdc_field
FORM bdc_field  USING    VALUE(P_0088)
                         VALUE(P_0089).
   CLEAR W_BDCDATA.
   w_bdcdata-fnam = p_0088.
   w_bdcdata-fval = p_0089.
   append w_bdcdata to t_bdcdata.
ENDFORM.                    " bdc_field
*&      Form  SUB_GET_MESG
FORM SUB_GET_MESG .
DATA: L_MSG(100).
LOOP AT t_bdcmsgcoll INTO W_BDCMSGCOLL.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
   ID              = W_BDCMSGCOLL-MSGID
   LANG            = W_BDCMSGCOLL-MSGSPRA
   NO              = W_BDCMSGCOLL-MSGNR
   V1              = W_BDCMSGCOLL-MSGV1
   V2              = W_BDCMSGCOLL-MSGV2
   V3              = W_BDCMSGCOLL-MSGV3
   V4              = W_BDCMSGCOLL-MSGV4
IMPORTING
   MSG             = L_MSG
EXCEPTIONS
  NOT_FOUND       = 1
  OTHERS          = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
WRITE: / L_MSG.
ENDLOOP.
ENDFORM.                    " SUB_GET_MESG

Similar Messages

  • URGENT : Record Group Problem

    hello all
    i have a problem regarding record group.
    i want to populate my record group with a dynamic clause which is
    "and main_code not in ('02725','02868')"
    and my record group query is
    "select mt.main_number from main_table mt,main_parent mp
    where mt.main_code = mp.main_code
    and mt.main_code not in (:parameter.param_main_code)"
    now i am adopting the following method for populating the
    LOV(list of values) which is attached to a text item:
    assigning values i.e. '02725','02868' to my parameter object i.e. :parameter.param_main_code but the record group is not giving changd results according to my criteria i.e.'02725','02868'...
    does any body knows the solution for this problem..kindly help him with it..logically the record group query should work and return a changed results for the LOV..
    please help me with this.....
    thank you.

    I thing you can't able to do what you are trying to do, but you can achive this by using dynamic record group.
    Create the dynamic record as same struncture of design time then populate it by the coding.
    Sample Code is
    declare
         l_rec_name RecordGroup;
         l_rec_col GroupColumn;
         l_rec_col1 GroupColumn;     
         cursor l_ename is select ename from emp;
         l_row number(12):= 1;
    begin
         l_rec_name := create_group('rg_dynamic',Form_scope, 100);
         l_rec_col := add_group_column(l_rec_name,'ENAME',char_column,30);
         l_rec_col1 := add_group_column(l_rec_name,'EMPNO',number_column,6);     
         for i in l_ename
         loop
              add_group_row(l_rec_name, end_of_group);
    set_group_char_cell(l_rec_col,l_row, i.ename);
    set_group_number_cell(l_rec_col1,l_row, l_row);
    l_row := l_row+1;
         end loop;
         :parameter.num_rows := l_row -1;
         set_lov_property('LOV5',group_name,'RG_DYNAMIC');
    end;
    I hope this will help you to solve this problem.
    [email protected]

  • Urgent help needed: how to display a list of records on the screen

    Hello,
    This is very urgent. Can anyone help me. I have posted this query of mine before also but still no reply came. My whole application is dependent on this problem. Actually I am developing an application for mobile phone using MIDP. I have a record store which contains personal details for users. I am able to add records to the record store. Now I want that these records can be edited. For this I want to display a list of firstname field on the screen (and not console) so that i can select a user to edit its details. I have written the code to read the records and individual fields and display it on the console but i want to display that list on screen. I tried list and array but it s giving some error.
    I am giving the code to read the records below. Please tell me how can I display it in a list on the screen.
    public void readStream(){
    try
    byte[] recData=new byte[50];
    String varname;
    ByteArrayInputStream strmBytes = new ByteArrayInputStream(recData);
    DataInputStream strmData=new DataInputStream(strmBytes);
    if (rsperdt.getNumRecords() > 0){
    ComparatorString comp=new ComparatorString();
    int i=1;
    RecordEnumeration re=rsperdt.enumerateRecords(null, comp, false);
    while(re.hasNextElement()){
    rsperdt.getRecord(re.nextRecordId(), recData,0);
    System.out.println("Record #" + i );
    varname = strmData.readUTF();
    System.out.println("Name #"+varname);
    System.out.println("---------------------------");
    i=i+1;
    strmBytes.reset();
    comp.compareStringClose();
    re.destroy();
    strmBytes.close();
    catch(Exception e){
    System.err.println("read Records class:read");
    }

    I could not understand ur point "post the code in tags". I am pasting the code below. Please help as my whole application is stuck due to this problem and I have a deadline of 7th oct.
    This midlet is getting called from some other midlet.
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;
    import javax.microedition.rms.*;
    import java.io.*;
    import java.util.*;
    public class frmread extends Form implements CommandListener
    static final String rec_store="db_per";
    private RecordStore rsperdt=null;
    private Vector vecname;
    private ChoiceGroup chname;
    private boolean flagSortByPriority = false, flagShowPriority = true;
    private Form fmmain;
    private Command cmdBack;
    private teledoc midlet;
    public frmread(String title, teledoc midlet)
    super(title);
    this.midlet = midlet;
    openRecStore();
    this.setCommandListener(this);
         chname = new ChoiceGroup("new", Choice.EXCLUSIVE);
         vecname = new Vector();
         cmdBack = new Command("Back", Command.BACK, 1);
    fmmain = new Form("Record Search");
         addCommand(cmdBack);
    setCommandListener(this);
    readStream();
         rebuildTodoList();
         closeRecStore();
    * Process events for this form only
    protected void rebuildTodoList()
    for(int j=chname.size(); j>0; j--)
         chname.delete(j-1);
         int priority;
         todoitem item;
         String text;
         StringBuffer sb;
         for (int j=0; j<vecname.size(); j++)
              item=(todoitem) vecname.elementAt(j);
              priority = item.getPriority();
              text = item.getText();
              sb = new StringBuffer((flagShowPriority ? (Integer.toString(priority) + "-"): ""));
              sb.append(text);
              chname.append(sb.toString(), null);
    public void commandAction(Command c, Displayable s)
    if (c == cmdBack){
    midlet.displayteledoc();
    public void readStream(){
    try
    byte[] recData=new byte[100];
    String varname;
    int varname1=0;
         ByteArrayInputStream strmBytes = new ByteArrayInputStream(recData);
         DataInputStream strmData=new DataInputStream(strmBytes);
         if (rsperdt.getNumRecords() > 0){
    ComparatorString comp=new ComparatorString();
    int i=1;
              int id = 1;
              vecname.removeAllElements();
              RecordEnumeration re=rsperdt.enumerateRecords(null, comp, false);
    while(re.hasNextElement()){
         rsperdt.getRecord(re.nextRecordId(), recData,0);
    System.out.println("Record #" + i );
    varname = strmData.readUTF();
                   varname1 = strmData.readInt();
                   id = re.nextRecordId();
                   System.out.println("Name #"+varname);
                   todoitem item = new todoitem(varname1, varname, id);
                   vecname.addElement(item);
                   System.out.println("---------------------------");
                   i=i+1;
    strmBytes.reset();
              comp.compareStringClose();
              re.destroy();
    strmBytes.close();
    catch(Exception e){
    System.err.println("read Records class:read");
    public void openRecStore(){
    try{
    rsperdt=RecordStore.openRecordStore("db_per",true);
    catch(RecordStoreException e){
    db(e.toString());
    public void closeRecStore(){
    try{
    rsperdt.closeRecordStore();
    catch(Exception e){
    db(e.toString());
    public void db(String str){
    System.err.println("Msg:" + str);
    class ComparatorString implements RecordComparator{
    private byte[] recData = new byte[20];
    private ByteArrayInputStream strmBytes = null;
    private DataInputStream strmDataType = null;
    public void compareStringClose(){
    try{
    if(strmBytes != null)
         strmBytes.close();
    if(strmDataType != null)
         strmDataType.close();
         catch (Exception e)
    public int compare(byte[] rec1, byte[] rec2)
         String str1, str2;
         try {
              int maxsize = Math.max(rec1.length, rec2.length);
              if (maxsize > recData.length)
              recData = new byte[maxsize];
                   strmBytes = new ByteArrayInputStream(rec1);
                   strmDataType = new DataInputStream(strmBytes);
                   str1=strmDataType.readUTF();
                   strmBytes = new ByteArrayInputStream(rec2);
                   strmDataType = new DataInputStream(strmBytes);
                   str2=strmDataType.readUTF();
                   int result=str1.compareTo(str2);
                   if (result == 0)
                   return RecordComparator.EQUIVALENT;
                   else if (result < 0)
                   return RecordComparator.PRECEDES;
                   else
                   return RecordComparator.FOLLOWS;
                   catch (Exception e)
                   return RecordComparator.EQUIVALENT;

  • URGENT: Selecting only 25 records at a time from a table

    URGENT !!!!
    Hi,
    Im having a RFC which selects records from a table (say table_A) and depending on these selected records, further processing is done within that RFC.
    Now my problem is, this table_A contains around 200 matching records. Due to this entire logical processing consumes lot of time. Hence my RFC is taking huge time to produce result. (apprx 10 mins).
    Can i select these matching records in batch of 25 and display result for these 25 records??
    I'll give this batch size as input to RFC?
    Do anybody have any idea about how to tackle this situation and reduce response time?
    If u hav any better solution than this then pls pls let me know ASAP..
    Regards,
    Amey

    Amey Mogare  ,
                             Do One thing , create  a new importing parameter in your RFC , say current_trans_id. NOw on the first call pass the initial value for current_trans_id.
    then inside the logic .. change the select to
    select upto 25 rows where trnascation id > current_trans_id.
    next time when u call teh rfc.. send the last selected id as a value for current_trans_id.
    i think you can some how use this logic
    Regards
    Sarath

  • Urgent: Error-Record 39,779, segment 0001 is not in the cross-record table

    Hi Gurus,
    This is an urgent production issue: I got the following error-
    I am updating data records from a DSO to Infocube in delta mode,
    1.Record 39,779, segment 0001 is not in the cross-record table
    2.Error in substep: End Routine
    I dont know problem is in the End Routine or somewhere else,
    The End routine is this:
    PROGRAM trans_routine.
          CLASS routine DEFINITION
    CLASS lcl_transform DEFINITION.
      PUBLIC SECTION.
    Attributs
        DATA:
          p_check_master_data_exist
                TYPE RSODSOCHECKONLY READ-ONLY,
    *-    Instance for getting request runtime attributs;
        Available information: Refer to methods of
        interface 'if_rsbk_request_admintab_view'
          p_r_request
                TYPE REF TO if_rsbk_request_admintab_view READ-ONLY.
      PRIVATE SECTION.
        TYPE-POOLS: rsd, rstr.
      Rule specific types
        TYPES:
          BEGIN OF tys_TG_1,
         InfoObject: ZVEHICLE Unique Vehicle ID.
            /BIC/ZVEHICLE           TYPE /BIC/OIZVEHICLE,
         InfoObject: ZLOCID Mine Site.
            /BIC/ZLOCID           TYPE /BIC/OIZLOCID,
         InfoObject: ZLOCSL Location Storage Location.
            /BIC/ZLOCSL           TYPE /BIC/OIZLOCSL,
         InfoObject: 0VENDOR Vendor.
            VENDOR           TYPE /BI0/OIVENDOR,
         InfoObject: ZNOMTK Nomination Number.
            /BIC/ZNOMTK           TYPE /BIC/OIZNOMTK,
         InfoObject: ZNOMIT Nomination Item.
            /BIC/ZNOMIT           TYPE /BIC/OIZNOMIT,
         InfoObject: ZNOMNR Nomination number.
            /BIC/ZNOMNR           TYPE /BIC/OIZNOMNR,
         InfoObject: ZVSTTIME Vehicle Starting Time Stamp.
            /BIC/ZVSTTIME           TYPE /BIC/OIZVSTTIME,
         InfoObject: ZVEDTIME Vehicle Ending Time Stamp.
            /BIC/ZVEDTIME           TYPE /BIC/OIZVEDTIME,
         InfoObject: ZNETWT Net Weight.
            /BIC/ZNETWT           TYPE /BIC/OIZNETWT,
         InfoObject: TU_GRS_WG Gross Wgt.
            /BIC/TU_GRS_WG           TYPE /BIC/OITU_GRS_WG,
         InfoObject: ZTU_TRE_W Tare Wgt.
            /BIC/ZTU_TRE_W           TYPE /BIC/OIZTU_TRE_W,
         InfoObject: ZCUSTWT Customer Weight.
            /BIC/ZCUSTWT           TYPE /BIC/OIZCUSTWT,
         InfoObject: ZCAR_NO Car Number.
            /BIC/ZCAR_NO           TYPE /BIC/OIZCAR_NO,
         InfoObject: ZINBND_ID Train Consist Inbound ID.
            /BIC/ZINBND_ID           TYPE /BIC/OIZINBND_ID,
         InfoObject: ZOTBND_ID Train Consist Return Load.
            /BIC/ZOTBND_ID           TYPE /BIC/OIZOTBND_ID,
         InfoObject: 0SOLD_TO Sold-to Party.
            SOLD_TO           TYPE /BI0/OISOLD_TO,
         InfoObject: 0CUSTOMER Customer Number.
            CUSTOMER           TYPE /BI0/OICUSTOMER,
         InfoObject: 0SHIP_TO Ship-To Party.
            SHIP_TO           TYPE /BI0/OISHIP_TO,
         InfoObject: ZVEHI_NO Vehicle Number.
            /BIC/ZVEHI_NO           TYPE /BIC/OIZVEHI_NO,
         InfoObject: ZCARSTDAT Car Start Date.
            /BIC/ZCARSTDAT           TYPE /BIC/OIZCARSTDAT,
         InfoObject: ZCAREDDAT Car End Date.
            /BIC/ZCAREDDAT           TYPE /BIC/OIZCAREDDAT,
         InfoObject: ZCARSTTIM Car Start Time.
            /BIC/ZCARSTTIM           TYPE /BIC/OIZCARSTTIM,
         InfoObject: ZCAREDTIM Car End Time.
            /BIC/ZCAREDTIM           TYPE /BIC/OIZCAREDTIM,
         InfoObject: 0COMPANY Company.
            COMPANY           TYPE /BI0/OICOMPANY,
         InfoObject: ZCONTRACT Contract.
            /BIC/ZCONTRACT           TYPE /BIC/OIZCONTRACT,
         InfoObject: 0PLANT Plant.
            PLANT           TYPE /BI0/OIPLANT,
         InfoObject: ZLOADTIME Total Vehicle Loading time.
            /BIC/ZLOADTIME           TYPE /BIC/OIZLOADTIME,
         InfoObject: ZSHIPDATE Shipping Date.
            /BIC/ZSHIPDATE           TYPE /BIC/OIZSHIPDATE,
         InfoObject: ZSHIPTIME Shipping Time.
            /BIC/ZSHIPTIME           TYPE /BIC/OIZSHIPTIME,
         InfoObject: ZMNEDDT Manifest End Date.
            /BIC/ZMNEDDT           TYPE /BIC/OIZMNEDDT,
         InfoObject: ZMNEDTM Manifest End Time.
            /BIC/ZMNEDTM           TYPE /BIC/OIZMNEDTM,
         InfoObject: ZLDEDDT Loaded End Date.
            /BIC/ZLDEDDT           TYPE /BIC/OIZLDEDDT,
         InfoObject: ZLDEDTM Loaded End Time.
            /BIC/ZLDEDTM           TYPE /BIC/OIZLDEDTM,
         InfoObject: ZMANVAR Manifest Variance.
            /BIC/ZMANVAR           TYPE /BIC/OIZMANVAR,
         InfoObject: ZTU_TYPE Trpr Unit Type.
            /BIC/ZTU_TYPE           TYPE /BIC/OIZTU_TYPE,
         InfoObject: ZACTULQTY Actual posted quantity.
            /BIC/ZACTULQTY           TYPE /BIC/OIZACTULQTY,
         InfoObject: ZVEDDT Vehicle End Date.
            /BIC/ZVEDDT           TYPE /BIC/OIZVEDDT,
         InfoObject: ZVEDTM Vehicle End Time.
            /BIC/ZVEDTM           TYPE /BIC/OIZVEDTM,
         InfoObject: ZVSTDT Vehicle Start Date.
            /BIC/ZVSTDT           TYPE /BIC/OIZVSTDT,
         InfoObject: ZVSTTM Vehicle Start Time.
            /BIC/ZVSTTM           TYPE /BIC/OIZVSTTM,
         InfoObject: ZTRPT_TYP Vehicle type.
            /BIC/ZTRPT_TYP           TYPE /BIC/OIZTRPT_TYP,
         InfoObject: 0CALMONTH Calendar Year/Month.
            CALMONTH           TYPE /BI0/OICALMONTH,
         InfoObject: 0CALYEAR Calendar Year.
            CALYEAR           TYPE /BI0/OICALYEAR,
         InfoObject: ZLOEDDT Quality Sent End Date.
            /BIC/ZLOEDDT           TYPE /BIC/OIZLOEDDT,
         InfoObject: ZLOEDTM Quality sent End Time.
            /BIC/ZLOEDTM           TYPE /BIC/OIZLOEDTM,
         InfoObject: ZATMDDT At Mine End Date.
            /BIC/ZATMDDT           TYPE /BIC/OIZATMDDT,
         InfoObject: ZATMDTM At Mine End Time.
            /BIC/ZATMDTM           TYPE /BIC/OIZATMDTM,
         InfoObject: ZDELAY Delay Duration.
            /BIC/ZDELAY           TYPE /BIC/OIZDELAY,
         InfoObject: ZSITYP Schedule type.
            /BIC/ZSITYP           TYPE /BIC/OIZSITYP,
         InfoObject: ZDOCIND Reference document indicator.
            /BIC/ZDOCIND           TYPE /BIC/OIZDOCIND,
         InfoObject: 0BASE_UOM Base Unit of Measure.
            BASE_UOM           TYPE /BI0/OIBASE_UOM,
         InfoObject: 0UNIT Unit of Measure.
            UNIT           TYPE /BI0/OIUNIT,
         InfoObject: ZACT_UOM Actual UOM.
            /BIC/ZACT_UOM           TYPE /BIC/OIZACT_UOM,
         Field: RECORD.
            RECORD           TYPE RSARECORD,
          END   OF tys_TG_1.
        TYPES:
          tyt_TG_1        TYPE STANDARD TABLE OF tys_TG_1
                            WITH NON-UNIQUE DEFAULT KEY.
    $$ begin of global - insert your declaration only below this line  -
    ... "insert your code here
    $$ end of global - insert your declaration only before this line   -
        METHODS
          end_routine
            IMPORTING
              request                  type rsrequest
              datapackid               type rsdatapid
            EXPORTING
              monitor                  type rstr_ty_t_monitors
            CHANGING
              RESULT_PACKAGE              type tyt_TG_1
            RAISING
              cx_rsrout_abort.
        METHODS
          inverse_end_routine
            IMPORTING
              i_th_fields_outbound         TYPE rstran_t_field_inv
              i_r_selset_outbound          TYPE REF TO cl_rsmds_set
              i_is_main_selection          TYPE rs_bool
              i_r_selset_outbound_complete TYPE REF TO cl_rsmds_set
              i_r_universe_inbound         TYPE REF TO cl_rsmds_universe
            CHANGING
              c_th_fields_inbound          TYPE rstran_t_field_inv
              c_r_selset_inbound           TYPE REF TO cl_rsmds_set
              c_exact                      TYPE rs_bool.
    ENDCLASS.                    "routine DEFINITION
    $$ begin of 2nd part global - insert your code only below this line  *
    ... "insert your code here
    $$ end of 2nd part global - insert your code only before this line   *
          CLASS routine IMPLEMENTATION
    CLASS lcl_transform IMPLEMENTATION.
          Method end_routine
          Calculation of result package via end routine
          Note: Update of target fields depends on rule assignment in
          transformation editor. Only fields that have a rule assigned,
          are updated to the data target.
      <-> result package
      METHOD end_routine.
    *=== Segments ===
        FIELD-SYMBOLS:
          <RESULT_FIELDS>    TYPE tys_TG_1.
        DATA:
          MONITOR_REC     TYPE rstmonitor.
    *$*$ begin of routine - insert your code only below this line        *-*
    Fill the following fields by reading Nomination and Vehicls DSO
    SOLD_TO, Customer
    data: L_TIMESTAMP1 TYPE timestamp,
          L_TIMESTAMP2 TYPE timestamp,
          L_TIMESTAMP3 type CCUPEAKA-TIMESTAMP,
          L_TIMESTAMP4 type CCUPEAKA-TIMESTAMP,
          L_TIMESTAMP5 type CCUPEAKA-TIMESTAMP,
          L_TIMESTAMP6 type CCUPEAKA-TIMESTAMP,
          L_TIMESTAMP7 TYPE timestamp,
          L_TIMESTAMP8 TYPE timestamp,
          L_TIMESTAMP9 type timestamp,
          L_TIMESTAMP10 type TIMESTAMP,
          L_CHAR1(14),
          L_CHAR2(14),
          l_duration type I,
          L_TS TYPE TZONREF-TZONE,
          l_flag,
          l_nomit TYPE /BIC/OIZNOMIT,
          l_error_flag.
    l_TS = 'CST'.
    Data: EXTRA_PACKAGE type tyt_TG_1.
    data: extra_fields type tys_TG_1.
    LOOP at RESULT_PACKAGE ASSIGNING <RESULT_FIELDS>.
    clear l_error_flag.
    Get sold_to and customer from nomination table.
       Select single SOLD_TO /BIC/ZLOCSL /BIC/ZCONTRACT COMPANY
                     /BIC/ZMNEDDT /BIC/ZMNEDTM /BIC/ZLDEDDT
                     /BIC/ZLDEDTM SHIP_TO /BIC/ZACTULQTY
                     /BIC/ZLOEDDT /BIC/ZLOEDTM /BIC/ZDELAY
                     /BIC/ZATMDDT /BIC/ZATMDTM
                     /BIC/ZSITYP /BIC/ZDOCIND
               into (<RESULT_FIELDS>-SOLD_TO,
                     <RESULT_FIELDS>-/BIC/ZLOCSL,
                     <RESULT_FIELDS>-/BIC/ZCONTRACT,
                     <RESULT_FIELDS>-company,
                     <RESULT_FIELDS>-/BIC/ZMNEDDT,
                     <RESULT_FIELDS>-/BIC/ZMNEDTM,
                     <RESULT_FIELDS>-/BIC/ZLDEDDT,
                     <RESULT_FIELDS>-/BIC/ZLDEDTM,
                     <RESULT_FIELDS>-SHIP_TO,
                     <RESULT_FIELDS>-/BIC/ZACTULQTY,
                     <RESULT_FIELDS>-/BIC/ZLOEDDT,
                     <RESULT_FIELDS>-/BIC/ZLOEDTM,
                     <RESULT_FIELDS>-/BIC/ZDELAY,
                     <RESULT_FIELDS>-/BIC/ZATMDDT,
                     <RESULT_FIELDS>-/BIC/ZATMDTM,
                     <RESULT_FIELDS>-/BIC/ZSITYP,
                     <RESULT_FIELDS>-/BIC/ZDOCIND)
               from   /BIC/AZTSW_0000
               where /BIC/ZNOMTK = <RESULT_FIELDS>-/BIC/ZNOMTK
                AND  /BIC/ZNOMIT = <RESULT_FIELDS>-/BIC/ZNOMIT.
    Select Invalid Nominations
      if sy-subrc <> 0.
        l_error_flag = 'X'.
      endif.
       <RESULT_FIELDS>-customer = <RESULT_FIELDS>-SOLD_TO.
    Prepare time stamp for Time Differences
    Vehicle Starting Time Stamp
      clear : L_TIMESTAMP9,L_TIMESTAMP10.
      CONVERT DATE <RESULT_FIELDS>-/BIC/ZCARSTDAT TIME
                   <RESULT_FIELDS>-/BIC/ZCARSTTIM
               INTO TIME STAMP L_TIMESTAMP9 TIME ZONE l_TS.
    Vehicle Ending Time Stamp
      CONVERT DATE <RESULT_FIELDS>-/BIC/ZCAREDDAT TIME
                   <RESULT_FIELDS>-/BIC/ZCAREDTIM
               INTO TIME STAMP L_TIMESTAMP10 TIME ZONE l_TS.
      Clear : L_TIMESTAMP3, L_TIMESTAMP4,
             <RESULT_FIELDS>-/BIC/ZVEDTIME,
             <RESULT_FIELDS>-/BIC/ZVSTTIME.
      <RESULT_FIELDS>-/BIC/ZVEDTIME = L_TIMESTAMP10.
      <RESULT_FIELDS>-/BIC/ZVSTTIME = L_TIMESTAMP9.
      L_TIMESTAMP3 = L_TIMESTAMP10.
      L_TIMESTAMP4 = L_TIMESTAMP9.
    Caliculate the load time
    IF L_TIMESTAMP3 is initial.
       clear <RESULT_FIELDS>-/BIC/ZLOADTIME.
    elseif L_TIMESTAMP4 is initial.
       clear <RESULT_FIELDS>-/BIC/ZLOADTIME.
    else.
       CALL FUNCTION 'CCU_TIMESTAMP_DIFFERENCE'
         EXPORTING
           timestamp1       =  L_TIMESTAMP3
           timestamp2       =  L_TIMESTAMP4
         IMPORTING
           DIFFERENCE        = <RESULT_FIELDS>-/BIC/ZLOADTIME
    ENDIF.
    Caliculate the Manifest Variance
       clear : L_TIMESTAMP5,L_TIMESTAMP6,L_TIMESTAMP7,L_TIMESTAMP8.
       CONVERT DATE <RESULT_FIELDS>-/BIC/ZMNEDDT TIME
                    <RESULT_FIELDS>-/BIC/ZMNEDTM
               INTO TIME STAMP L_TIMESTAMP7 TIME ZONE l_TS.
       CONVERT DATE <RESULT_FIELDS>-/BIC/ZLDEDDT TIME
                    <RESULT_FIELDS>-/BIC/ZLDEDTM
               INTO TIME STAMP L_TIMESTAMP8 TIME ZONE l_TS.
      L_TIMESTAMP5 = L_TIMESTAMP7.
      L_TIMESTAMP6 = L_TIMESTAMP8.
    Caliculate the Maniefest Variance
    IF L_TIMESTAMP5 is initial.
       clear <RESULT_FIELDS>-/BIC/ZMANVAR.
    elseif L_TIMESTAMP6 is initial.
       clear <RESULT_FIELDS>-/BIC/ZMANVAR.
    else.
       CALL FUNCTION 'CCU_TIMESTAMP_DIFFERENCE'
         EXPORTING
           timestamp1       =  L_TIMESTAMP5
           timestamp2       =  L_TIMESTAMP6
         IMPORTING
           DIFFERENCE        = <RESULT_FIELDS>-/BIC/ZMANVAR
       IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
       ENDIF.
    ENDIF.
    Delete datapackets with blank nominations
    Delete datapackets with blank shipdate and Invalid Time Stamps
    *IF <RESULT_FIELDS>-/BIC/ZNOMTK IS INITIAL OR
      <RESULT_FIELDS>-/BIC/ZSHIPDATE IS INITIAL.
    l_error_flag = 'X'.
    *ENDIF.
    <RESULT_FIELDS>-/BIC/ZVEHI_NO = 1.
      <RESULT_FIELDS>-CALMONTH = <RESULT_FIELDS>-/BIC/ZSHIPDATE(6).
      <RESULT_FIELDS>-CALYEAR  = <RESULT_FIELDS>-/BIC/ZSHIPDATE(4).
    if l_error_flag = 'X'.
    Looks like Monitor Entries are not working in SP11.
    Hence the following is commented temporarily.
    CLEAR MONITOR_REC.
    MONITOR_REC-MSGID = '0M'.
    MONITOR_REC-MSGTY = 'S'.
    MONITOR_REC-MSGNO = '501'.
    MONITOR_REC-MSGV1 = <RESULT_FIELDS>-/BIC/ZNOMTK.
    MONITOR_REC-recno = sy-tabix.
    APPEND MONITOR_REC to MONITOR.
    RAISE exception type CX_RSROUT_ABORT.
    DELETE RESULT_PACKAGE index sy-tabix.
    CLEAR L_ERROR_FLAG.
    else.
       MODIFY RESULT_PACKAGE FROM <RESULT_FIELDS>.
    endif.
    clear l_nomit.
    l_nomit = <RESULT_FIELDS>-/BIC/ZNOMIT.
    extra_fields = <RESULT_FIELDS>.
    Actual Qty and Contract details
       Select /BIC/ZLOCSL /BIC/ZNOMIT /BIC/ZCONTRACT /BIC/ZACTULQTY
              /BIC/ZSITYP /BIC/ZDOCIND
              SOLD_TO SHIP_TO COMPANY
               into (extra_fields-/BIC/ZLOCSL,
                     extra_fields-/BIC/ZNOMIT,
                     extra_fields-/BIC/ZCONTRACT,
                     extra_fields-/BIC/ZACTULQTY,
                     extra_fields-/BIC/ZSITYP,
                     extra_fields-/BIC/ZDOCIND,
                     extra_fields-SOLD_TO,
                     extra_fields-SHIP_TO,
                     extra_fields-company)
               from  /BIC/AZTSW_0000
               where /BIC/ZNOMTK = <RESULT_FIELDS>-/BIC/ZNOMTK AND
                     /BIC/ZNOMIT <> l_NOMIT.
           INSERT extra_fields into table EXTRA_PACKAGE.
       endselect.
    ENDLOOP.
    Append lines of extra_package to RESULT_PACKAGE.
    *--  fill table "MONITOR" with values of structure "MONITOR_REC"
    *-   to make monitor entries
    ... "to cancel the update process
       raise exception type CX_RSROUT_ABORT.
    $$ end of routine - insert your code only before this line         -
      ENDMETHOD.                    "end_routine
          Method inverse_end_routine
          This subroutine needs to be implemented only for direct access
          (for better performance) and for the Report/Report Interface
          (drill through).
          The inverse routine should transform a projection and
          a selection for the target to a projection and a selection
          for the source, respectively.
          If the implementation remains empty all fields are filled and
          all values are selected.
      METHOD inverse_end_routine.
    $$ begin of inverse routine - insert your code only below this line-
    ... "insert your code here
    $$ end of inverse routine - insert your code only before this line -
      ENDMETHOD.                    "inverse_end_routine
    ENDCLASS.                    "routine IMPLEMENTATION

    Hi,
    Most probably you are appending some records in the data package or deleting from the data package through end routine or expert routine or start routine.
    I just solved it.....you will have to import the note 1180163.
    Then modify the code which you are using....and include the function module as mentioned in the note 1223532.
    You need to add the function module just before you append the records.This will work perfectly.
    Thanks
    Ajeet

  • Duplicate records found while loading master data(very urgent)

    Hi all,
    One infopackage in the process chain failed while laoding the master data(full update).Its showing the following error-->duplicate record found ..1 record used in /BI0/PTCTQUERY and the same record occured in /BI0/PTCTQUERY tables.
    can anyone give me the solution...its very urgent...
    Thanks & Regards,
    Manjula

    Hi
    You can see the check box in the Processing tab page. Make a tick mark for the check box Ignore Duplicate Data Records indicator . When multiple data records that have the same key are transferred, the last data record in the request is updated to BI. Any other data records in the request with the same key are ignored.
    Help says that:
    To maintain consistency, ignoring duplicate data records is only possible if the data is updated serially. A serial update is when data is first updated into the PSA then, after it has been successfully written to the PSA, it is updated into the master data or text tables of the InfoObject.
    If a DataSource transfers potentially duplicate data records or if you manually set the Ignore Duplicate Data Records indicator, the PSA Only update type is automatically selected in the scheduler.
    hope it clears ur doubt, otherwise let me know.
    Regards
    Kiran

  • Hi All,Issue regarding bdc for capturing error records,its urgent

    Hi All,
            My requirement is to capture the error record and download the error record to a flat file .
    I have done recording for MM01 transaction .
    I am getting a problem like no error records are downloaded into the flat file .It is downloading only the empty records.
    Pls see the below code which i developed & modify it for any changes .Its an urgent .Pls provide me the solution ASAP.
    My Flat file
    M     FERT     X     MATL105     KG     
    X     FERT     X     MATL106     KG
    In the above flat file 'X' is an Industry sector which doesnot exists which is an error record that has to be captured and download it into the flat file .
    Source code :
    report Z_MM01_MSG_F MESSAGE-ID MSG1
           no standard page heading line-size 255.
    include bdcrecx1.
    parameters: dataset(132) lower case.
       DO NOT CHANGE - the generated data section - DO NOT CHANGE    ***
      If it is nessesary to change the data section use the rules:
      1.) Each definition of a field exists of two lines
      2.) The first line shows exactly the comment
          '* data element: ' followed with the data element
          which describes the field.
          If you don't have a data element use the
          comment without a data element name
      3.) The second line shows the fieldname of the
          structure, the fieldname must consist of
          a fieldname and optional the character '_' and
          three numbers and the field length in brackets
      4.) Each field must be type C.
    Generated data section with specific formatting - DO NOT CHANGE  ***
    data: begin of record occurs 0,
    data element: MBRSH
            MBRSH_001(001),
    data element: MTART
            MTART_002(004),
    data element: XFELD
            KZSEL_01_003(001),
    data element: MAKTX
            MAKTX_004(040),
    data element: MEINS
            MEINS_005(003),
    data element: MTPOS_MARA
            MTPOS_MARA_006(004),
          end of record.
    *DECLARATION OF BDCDATA STRUCTURE
    DATA: IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE .
    *declaration to store the message
    DATA: IT_MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE .
    *DECLARATION TO STORE THE MESSAGE
    DATA: BEGIN OF IT_STORE_MSG OCCURS 0,
          STORE(1000),
          END OF IT_STORE_MSG.
    *declaration SUCCESS MESG
    DATA: BEGIN OF IT_SUCCESS OCCURS 0,
          SUCCESS_REC(10),
          MBRSH(10),
          TABIX LIKE SY-TABIX,
          END OF IT_SUCCESS.
    *declaration ERROR MESSAGE
    DATA: BEGIN OF IT_ERROR  OCCURS  0,
          ERROR_REC(10),
          MBRSH(10),
             TABIX LIKE SY-TABIX,
          END OF IT_ERROR.
    DATA:TABIX LIKE SY-TABIX.
    *validating Material type(mtart) field data with table T134
    data : v_type like T134-mtart.
    DATA: V_INDSECT LIKE MARA-MBRSH.
    End generated data section ***
    start-of-selection.
    CALL FUNCTION 'UPLOAD'
    EXPORTING
      CODEPAGE                      = ' '
      FILENAME                      = ' '
      FILETYPE                      = ' '
      ITEM                          = ' '
      FILEMASK_MASK                 = ' '
      FILEMASK_TEXT                 = ' '
      FILETYPE_NO_CHANGE            = ' '
      FILEMASK_ALL                  = ' '
      FILETYPE_NO_SHOW              = ' '
      LINE_EXIT                     = ' '
      USER_FORM                     = ' '
      USER_PROG                     = ' '
      SILENT                        = 'S'
    IMPORTING
      FILESIZE                      =
      CANCEL                        =
      ACT_FILENAME                  =
      ACT_FILETYPE                  =
      TABLES
        data_tab                      = record
    EXCEPTIONS
      CONVERSION_ERROR              = 1
      INVALID_TABLE_WIDTH           = 2
      INVALID_TYPE                  = 3
      NO_BATCH                      = 4
      UNKNOWN_ERROR                 = 5
      GUI_REFUSE_FILETRANSFER       = 6
      OTHERS                        = 7
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    *perform open_dataset using dataset.
    perform open_group.
    LOOP AT RECORD.
    perform bdc_dynpro      using 'SAPLMGMM' '0060'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RMMG1-MATNR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    *- Validating industry sector(MBRSH) from the master table(MARA)
    select single MBRSH from T137  into V_INDSECT where MBRSH eq
    record-MBRSH_001.
    IF SY-SUBRC EQ 0.
    perform bdc_field       using 'RMMG1-MBRSH'
                                  record-MBRSH_001.
    *endif.
    perform bdc_field       using 'RMMG1-MTART'
                                  record-MTART_002.
    perform bdc_dynpro      using 'SAPLMGMM' '0070'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MSICHTAUSW-DYTXT(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    perform bdc_field       using 'MSICHTAUSW-KZSEL(01)'
                                  record-KZSEL_01_003.
    perform bdc_dynpro      using 'SAPLMGMM' '4004'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  record-MAKTX_004.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MARA-MEINS'.
    perform bdc_field       using 'MARA-MEINS'
                                  record-MEINS_005.
    perform bdc_field       using 'MARA-MTPOS_MARA'
                                  record-MTPOS_MARA_006.
    perform bdc_dynpro      using 'SAPLSPO1' '0300'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=YES'.
    perform bdc_transaction using 'MM01'.
    *ELSE.
    *message  E000 WITH 'Industry sector does not Exist' .
    *endif.
    LOOP AT MESSTAB.
    CALL FUNCTION 'FORMAT_MESSAGE'
    EXPORTING
       ID              = MESSTAB-MSGID
       LANG            = MESSTAB-MSGSPRA
       NO              = MESSTAB-MSGNR
       V1              = MESSTAB-MSGV1
       V2              = MESSTAB-MSGV2
      V3              = SY-MSGV3
      V4              = SY-MSGV4
    IMPORTING
       MSG             = IT_STORE_MSG-STORE
       EXCEPTIONS
      NOT_FOUND       = 1
       OTHERS          = 0.
    IF MESSTAB-MSGTYP = 'S'.
       IT_SUCCESS-SUCCESS_REC = IT_STORE_MSG-STORE.
       IT_SUCCESS-MBRSH = record-MBRSH_001.
       IT_SUCCESS-TABIX = TABIX.
       APPEND IT_SUCCESS.
       ELSEIF  MESSTAB-MSGTYP = 'E'.
       IT_ERROR-ERROR_REC = IT_STORE_MSG-STORE.
       IT_ERROR-MBRSH = record-MBRSH_001.
       IT_ERROR-TABIX = TABIX.
      APPEND IT_ERROR.
    ENDIF.
    endloop.
    endif.
    ENDLOOP.
    CALL FUNCTION 'DOWNLOAD'
      TABLES
        DATA_TAB                      = IT_error
      FIELDNAMES                    =
    EXCEPTIONS
      INVALID_FILESIZE              = 1
      INVALID_TABLE_WIDTH           = 2
      INVALID_TYPE                  = 3
      NO_BATCH                      = 4
      UNKNOWN_ERROR                 = 5
      GUI_REFUSE_FILETRANSFER       = 6
      OTHERS                        = 7
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    perform close_group.
    *perform close_dataset using dataset.

    Hi,
    DATA: IT_MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE .
    CALL FUNCTION 'DOWNLOAD'
    TABLES
    DATA_TAB = IT_error
    FIELDNAMES =
    EXCEPTIONS
    INVALID_FILESIZE = 1
    INVALID_TABLE_WIDTH = 2
    INVALID_TYPE = 3
    NO_BATCH = 4
    UNKNOWN_ERROR = 5
    GUI_REFUSE_FILETRANSFER = 6
    OTHERS = 7.
    IF SY-SUBRC 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    instead of using IT_error ion tables use IT_MESSTAB.
    <REMOVED BY MODERATOR>
    Code Formatted by: Alvaro Tejada Galindo on Apr 9, 2008 5:07 PM

  • RECORDING WITH F-32 .......ITS URGENT PLZ HELP ME

    HI GUYS
    HERE IS MY REQUIREMENT
    I WANT TO DO A RECORDING USING F-32 AND I HAVE TO DO THE FOLLOWING WAYS
    1- ENTER ACCOUNT
    2-COMPANY CODE
    3-CLEARING DATE
    4-OPENITEM SELETION
    5-I HAVE TO SELECT THE REFERENCE RADIO BUTTON
    HERE IS MY ERROR , I DONT KNOW WHAT ARE THE VALUE I HAVE TO ENTER IN THE REFERENCE FIELD AND HOW TO PROCEED ,PLZ HELP ME IT IS VERY VERY URGENT FOR ME.
    THANKS A LOT
    MRUTYUN

    This should get you started:
    FORM clearing USING    p_purch_order
                           p_cus
                           p_ven.
      DATA: okcode(3).
      CLEAR bdcdata.
      CLEAR messtab.
      REFRESH bdcdata.
      REFRESH messtab.
      MESSAGE s205 WITH 'Clearing A/R Invoice to Invoice Receipt.'.
      PERFORM dynpro USING:
       'X' 'SAPMF05A'        '0131',       "Clear Customer: Header Data
       ' ' 'RF05A-AGKON'      bill_to,
       ' ' 'BKPF-BUDAT'       today_ch,
       ' ' 'BKPF-BUKRS'      'UOFT',
       ' ' 'BKPF-WAERS'      'CAD',
       ' ' 'RF05A-XNOPS'     'X',
       ' ' 'RF05A-XPOS1(2)'  'X',
       ' ' 'BDC_OKCODE'      '/16'.        "Process Open Items
      PERFORM dynpro USING:
       'X' 'SAPMF05A'        '0730',       "Amount popup
       ' ' 'BDC_OKCODE'      '/16'.        "Process Open Items
      PERFORM dynpro USING:
       'X' 'SAPMF05A'        '0730'.       "Press enter
      PERFORM dynpro USING:
       'X' 'SAPMF05A'        '0710',"Clear Customer: Enter selection criteri
       ' ' 'RF05A-AGBUK'     'UOFT',
       ' ' 'RF05A-AGKON'      bill_to,
       ' ' 'RF05A-AGKOA'     'D',
       ' ' 'RF05A-XNOPS'     'X',
       ' ' 'RF05A-XMULK'     'X',
       ' ' 'RF05A-XPOS1(1)'  'X',
       ' ' 'BDC_OKCODE'      '/16'.        "Process Open Items
      PERFORM dynpro USING:
       'X' 'SAPMF05A'        '0609',       "Additional Accounts popup
       ' ' 'RF05A-AGKON(1)'   p_ven,
       ' ' 'RF05A-AGKOA(1)'  'K',
       ' ' 'RF05A-XNOPS(1)'  'X'.
      PERFORM dynpro USING:
       'X' 'SAPDF05X'        '1102',       "Clear Customer: Select open item
       ' ' 'BDC_OKCODE'      'OMX'.        "Select all
      PERFORM dynpro USING:
       'X' 'SAPDF05X'        '1102',       "Clear Customer: Select open item
       ' ' 'BDC_OKCODE'      '/6'.         "Inactive
      PERFORM dynpro USING:
       'X' 'SAPDF05X'        '1102',       "Clear Customer: Select open item
       ' ' 'BDC_OKCODE'      '/6'.         "Find
      PERFORM dynpro USING:
       'X' 'SAPDF05X'        '2000',       "Select search criteria popup
       ' ' 'BDC_OKCODE'      '/24'.        "Next page
      PERFORM dynpro USING:
       'X' 'SAPDF05X'        '2000',       "Select search criteria popup
       ' ' 'RF05A-XPOS1(10)' 'X'.          "Allocation
      PERFORM dynpro USING:
       'X' 'SAPDF05X'        '0731',       "Search for Allocation
       ' ' 'RF05A-SEL01(1)'   p_purch_order.                    "PO
      PERFORM dynpro USING:
       'X' 'SAPDF05X'        '1102',       "Clear Customer: Select open item
       ' ' 'BDC_OKCODE'      'OMX'.        "Select all
      PERFORM dynpro USING:
    'X' 'SAPDF05X'        '1102',         "Clear Customer: Select open item
       ' ' 'BDC_OKCODE'    '/05'.          "Active
      IF p_test = space.
        okcode = '/11'.                    "save
      ELSE.
        okcode = 'BS'.                     "simulate
      ENDIF.
      PERFORM dynpro USING:
       'X' 'SAPDF05X'        '1102',
       ' ' 'BDC_OKCODE'       okcode.      " save or check
      IF p_test NE space.                  "exit from screen after check
        PERFORM dynpro USING:
         'X' 'SAPMF05A'        '0700',
         ' ' 'BDC_OKCODE'       '/15'.     "Save or check
        PERFORM dynpro USING:              "popup
         'X' 'SAPLSPO1'        '0200',
         ' ' 'BDC_CURSOR'      'SPOP-OPTION1'.       "choose yes
      ENDIF.
      CALL TRANSACTION 'F-32' USING bdcdata MODE u_mode UPDATE 'S'
                                            MESSAGES INTO messtab.
      PERFORM get_message TABLES messtab USING text 'CL'.
      IF text IS INITIAL.
        PERFORM batch_input USING 'F-32'.
      ENDIF.
    ENDFORM.                               " CLEARING
    Rob

  • Very Urgent-transaction is failed after record is added.

    Hi Gurus,
    This is Urgent requuirement that-
    1) i have a search page-in that detail icon to navigate detail page . in detail page i have a advance table contains(Supplier, Supplier Site Code,City State,Country,Status,StatusUpdateDate)
    these rows- at this moment all the rows of columnns are empty data.
    2)in detail page i have add supplier button to navigate to one more page, in add supplier page, i have a Supplier name Drop down list contains list of suppliers. user can select any one supplier from Drop down list
    and click the go button to get all records(Supplier, Supplier Site Code,City State,Country,Status,StatusUpdateDate) in advance table, up to this OK.
    3)now user click any of one check box associated with that row in advance table,click the button and come back to detail page with this records and store the table also.
    4)now new supplier added to the detail page.again user want to add one more supplier to click the add supplier button to navigate add supplier page, in add supplier page the supplier which i have selected first time is appeared in table and drop down list.
    actually it should have to come up with clean.
    Exactt problem is, first time  when i run the page add supplier page comes up with clean.after adding the supplier to detail page means after one transation i want to- Add supplier page in, supplier dropdown list and  table should come clean not old data.
    i hope requirement is clear you guys. please kindly any one help me regarding this.
    Thanks in advance,
    vamshi krishna

    hi vamshi
    in the controller of your supplier page go in in this way
    in processRequest method
    clear your VO like this
    OAApplicationModule am1 = pageContext.getApplicationModule(webBean);
    OAViewObject oav=(OAViewObject)am1.findViewObject("your VO");
    oav.setWhereClause(null);
    oav.setWhereClauseParams(null);
    oav.setWhereClause("1=2");
    oav.executeQuery();
    and in
    processForm request method set the where clause null again like this
    OAApplicationModule am1 = pageContext.getApplicationModule(webBean);
    OAViewObject oav=(OAViewObject)am1.findViewObject("your VO");
    oav.setWhereClause(null);
    hope this will resolve your issue
    thanx
    Pratap

  • Purchase Info record Datasource / Infosource (URGENT!!!)

    BW GURUS!
    My client has an urgent need to extract their Purchase infor record in R/3 to the BW Environment.
    I am still new to BW Application - My solution is creating a custom Datasource in R/3 using the Purchase infor record Master table in R/3, then assign my datasource to custom infosource that will be created in BW.
    Question - is there an existing datasource / infosource for Purchase record info in R/3 and BW Business content I can use.
    With my proposed solution I will end up creating custom info-objects to build the communication structure for my infosource - I am trying to avoid this route.
    Looking forward to your input.
    Thanks Guys,
       Frank Obasohan

    Thanks Ramki,
    I located the info-object 0INFO_REC in my BW Business Content T-CODE rsorbct, I selected the info-object draged it to the right open panel, selected all its components and clicked on the "Install Icon" to activate the object, its still greg out (inactive).
      How do I activate the object? what 'am I doing wrong
    - Frank

  • Dynamically appending records to an existing cursor---URGENT !!!

    Hi all,
    I'm right now creating dynamic statistical reports in Oracle 8.1.6 on Win NT.
    My query is as below:
    select
         TO_CHAR(a.jobpostingdate,'MM-DD-YYYY') jobpostingdate ,count(a.jobpostingid) no_jobs
    FROM
         JOBPOSTING a, EMPLOYEE f
    WHERE
         a.employeeid = f.employeeid AND
         f.companyid = 2 AND
         a.jobpostingdate between to_date('10-01-2002 00:00:00','mm-dd-yyyy hh24:mi:ss') AND
         to_date('10-01-2003 00:00:00','mm-dd-yyyy hh24:mi:ss')
    GROUP BY
         TO_CHAR(a.jobpostingdate,'MM-DD-YYYY')
    ORDER BY
         TO_CHAR(a.jobpostingdate,'MM-DD-YYYY')     
    This query will give me records for everyday. But if there is no record for a certain date, then I don't get that record. This is how it works.
    The result of the above query is as below:
    jobpostingdate no_jobs
    10-11-2002 1
    10-12-2002 5
    10-15-2002 4
    10-16-2002 2
    In the above resultset, There are no records displayed for 10-13-2002 and 10-14-2002. But my requirement is that I need both the records for 10-13-2002 and 10-14-2002 with the count as 0.
    Can anybody please tell me how I can do this? Is there a way in Oracle 8.1.6? And if I need to write a function for this how do I do it ? I'm not able to find any way to do this. Or Do I need to dynamically appened cursor or something? How do I solve this problem?
    Please give me a solution as soon as possible...this is very URGENT for me !!!
    Thanx,
    Madhavi

    I did not test this, but it should work.
    I understand from your posting that the missing dates are existing in the table but there is no match on these rows with employeeid join. If this is correct then the following should work,SELECT * FROM
    Select TO_CHAR(a.jobpostingdate,'MM-DD-YYYY') jobpostingdate, count(*) no_jobs
    FROM JOBPOSTING a, EMPLOYEE e
    WHERE e.companyid = 2
    AND   a.employeeid = e.employeeid
    AND   a.jobpostingdate between
          to_date('10-01-2002 00:00:00','mm-dd-yyyy hh24:mi:ss') AND
          to_date('10-01-2003 00:00:00','mm-dd-yyyy hh24:mi:ss')
    GROUP BY TO_CHAR(a.jobpostingdate,'MM-DD-YYYY')
    UNION
    Select TO_CHAR(a.jobpostingdate,'MM-DD-YYYY') jobpostingdate, 0 no_jobs
    FROM JOBPOSTING a
    WHERE NOT EXISTS( Select 'x' From EMPLOYEE e
                      WHERE e.companyid = 2 -- you might not need this condition
                AND   e.employeeid = a.employeeid)
    ORDER BY jobpostingdate;Thx,
    SriDHAR

  • Customer heirachy 3data is not populating in condition record(vk11)- urgent

    Gurus
    Please some one can help me on this issue , very urgent.
    also ask me if you have any further questions.
    my access seuqence  key combination are
    sales org,
    Distribution channel,
    customer heirarchy3 ,
    product heirachy1,
    product heirachy2,
    product heirachy3,
    product heirachy 4 and
    Materila group 4               total 8 fields
    for the above mentioned fields when trying to create condition record in vk11
    from drop down box I am not able to see data from customer heirarchy3-HIENR03(drop down box in condition record screen -vk11)  field --?
    whats wrong with that?
    how to solve this issue?
    thanks
    kris

    Some one can help me on this issue.
    thanks
    kris

  • Setting max record per page property at runtime (very urgent)

    We need to display 7 record for first page and 25 for other pages...
    we tried a reperating frame max record per page property is a report level property. So it cannot change for pages.
    Then We try other way..
    we seperated our query to the different frame to do these
    But we need to summaries some field at page level and
    reset at page has fallowing restriction
    "A Reset At of Page will not work for reports that have multiple repeating frames associated with a group that is involved in the summary. One common case of this is a matrix report. As a result, matrix reports cannot have page-level summaries."
    So all the ways we tried failed.
    How can we do this ... it is very urgent. (we can use any version of report.)
    Thanks for your help...

    repost

  • Urgent pls: Automatic mailing of Reports thru BDC recording

    Hi Gurus..
    Please guide me for the possibility of creating a Z program which should call the T. Code, supply parameters for execution & sending output by email.I
    need to execute 3 processes thru a single a program ..
    1. get the distribution list
    2. call the respective Tcode
    3. running the background job for saving the variant & passing it.
    Do I need to do recording thru BDC for each of them?
    How can i do so in this manner..kindly guide me..
    Pls experts need urgent help in this..
    Thanks..
    Himayan

    Hi,
    If the transaction codes you are referrring are associated to report programs, do as below:
    1. Submit required program with addition Exporting list to Memory.
    2. Read the list to an internal table
    3. Use the data to send as mail attachments.
    Check code samples in the below thread should you require the info:
    [Sending External mails with attachments|Re: events]
    Kind Regards
    Eswar

  • How to debug Delta records..urgent

    Hi All,
    I loaded some records with delta mode.
    In rsa3, I select delta mode D, and clk Excute button, But It is saying  "Error During Execution".
    A. What is the reason Can any one explain?
    B. How to Debug my delta records?
    Pls explain Urgent.
    Thanks & Regards,
    Lakshmi.K.

    Hi,
    in case of simulation of update mode D you also have to provide the name of your target system. Then check the box debug mode. After clicking the execution button you are in the coding right before the extraction fm gets called. Jump into in by pressing F5 ....
    But first of all you need to make sure that your datasource provides a delta (this may cause the 'error during execution').
    regards
    Siggi

Maybe you are looking for