Table maintenance problem

i have two tables zfm_handy (key fields r telnum and kartnr ) and zfmkstel key fields r telnum and nrart) i m writtin  coding for based on zfm_handy key fields to get the corresponding data filled by using report.their new requirement is telnum is the telephone number +49(151)11111111 fot this telnum  nrart and proz1 fields showing blank thwy ask me u must fill these fields nrart = 'h'(key field) and proz1 = 100,00( not a key field) . how can i fill with this record.
data : fs_zfm_handy like zfm_handy,
       fs_zfmkstel like zfmkstel,
       fs_temp_zfm_handy like zfm_handy,
       fs_temp_zfmkstel like zfmkstel.
data : t_table1 like table of fs_zfm_handy.
data : ok_code type sy-ucomm,
        save_ok like sy-ucomm.
data : f1_rec type i.
*data : w_telnum like fs_temp_zfm_handy-telnum,
      w_kartnr like fs_temp_zfm_handy-kartnr.
*data : ok_code(4).
call screen 600.
MODULE status_0600 OUTPUT
module status_0600  output.
  set pf-status 'ZSTATUS'.
  loop at screen.
*if screen-name = fs_temp_zfmkstel-kostl1 or screen-name = fs_temp_zfm_handy-zutart or
        screen-name = fs_temp_zfm_handy-pernr or screen-name = fs_temp_zfm_handy-zdate or
           screen-name = fs_temp_zfm_handy-pinnr or screen-name = fs_temp_zfm_handy-puknr or
            screen-name = fs_temp_zfm_handy-tarif1 or screen-name = fs_temp_zfm_handy-tarif2 or
              screen-name = fs_temp_zfm_handy-tarif3 or screen-name = fs_temp_zfm_handy-gtype or
                screen-name = fs_temp_zfm_handy-imei or screen-name = fs_temp_zfm_handy-twincard or
                  screen-name = fs_temp_zfm_handy-twinbill or screen-name = fs_temp_zfm_handy-einbau or
                     screen-name = fs_temp_zfm_handy-beschr or screen-name = fs_temp_zfm_handy-text1 or
                       screen-name = fs_temp_zfm_handy-text2 or screen-name = fs_temp_zfm_handy-text3.
    if screen-name = fs_temp_zfmkstel-kostl1.
      if f1_rec = 1.
        screen-input = 0.
      else.
        screen-input = 1.
      endif.
      modify screen.
    endif.
  endloop.
endmodule.                    "status_0600 OUTPUT
MODULE USER_COMMAND_0600 INPUT
MODULE USER_COMMAND_0600 INPUT.
*ok_save = ok_code.
  save_ok = ok_code.
  CLEAR OK_CODE.
*CASE ok_code.
  case save_ok.
    when 'SAVE'.
      IF f1_rec ne 1 .
      if sy-subrc = 0.
      update zfm_handy from fs_temp_zfm_handy.
        insert zfm_handy from fs_temp_zfm_handy.
        MODIFY zfm_handy from fs_temp_zfm_handy.
       if sy-subrc = 0.
       insert zfmkstel from fs_temp_zfmkstel.
        if sy-subrc = 0.
          fs_temp_zfmkstel-telnum = fs_temp_zfm_handy-telnum.
          commit work.
          INSERT ZFMKSTEL FROM FS_TEMP_ZFMKSTEL.
          if sy-subrc = 0.
            message s000(0) with 'record havebeen updated successfully'.
        MODIFY ZFMKSTEL FROM FS_TEMP_ZFMKSTEL.
          else.
            delete zfm_handy from fs_temp_zfm_handy.
          endif.
        endif.
      else.
        update zfm_handy from fs_temp_zfm_handy.
        if sy-subrc eq 0.
          fs_temp_zfmkstel-telnum = fs_temp_zfm_handy-telnum.
          update zfmkstel from fs_temp_zfmkstel.
         if sy-subrc eq 0.
         message s000(0) with 'update sucessfully'.
       endif.
      endif.
      endif.
       endif.
    WHEN  'NEW'.
          Clear fs_temp_zfm_handy.
          clear fs_temp_zfmkstel.
          clear f1_rec.
     WHEN 'EXIT'.
          LEAVE PROGRAM.
    when OTHERS.
      if fs_temp_zfm_handy-telnum ne fs_zfm_handy-telnum or
          fs_temp_zfm_handy-kartnr ne fs_zfm_handy-kartnr.
        clear f1_rec.
        if  not fs_temp_zfm_handy-telnum is initial.
          if fs_temp_zfm_handy-kartnr is initial.
       clear: w_telnum , w_kartnr.
       move fs_temp_zfm_handy-telnum to w_telnum.
       move fs_temp_zfm_handy-kartnr to w_kartnr.
            select * from zfm_handy into table t_table1 where telnum = fs_temp_zfm_handy-telnum.
            IF sy-subrc EQ 0 and sy-dbcnt GT 1.
              message s000(0) with 'Mob:Nr has more that 1 entry. Please enter Karten number also to select the desired record'.
            ELSEIF
            sy-subrc EQ 0 and sy-dbcnt EQ 1.
              read table t_table1 into fs_zfm_handy index 1.
              If sy-subrc eq 0.
                fs_temp_zfm_handy = fs_zfm_handy.
                f1_rec = 1.
              endif.
            endif.
          else.
            select single * from zfm_handy into fs_zfm_handy where telnum = fs_temp_zfm_handy-telnum
                                    and kartnr = fs_temp_zfm_handy-kartnr.
            If sy-subrc eq 0.
              fs_temp_zfm_handy = fs_zfm_handy.
              f1_rec  = 1.
            endif.
          endif.
          if f1_rec = 1.
            select single * from zfmkstel into fs_zfmkstel  where telnum = fs_temp_zfm_handy-telnum.
            If sy-subrc eq 0.
              fs_temp_zfmkstel = fs_zfmkstel.
            endif.
          endif.
        endif.
      endif.
  endcase.
endmodule.                    "USER_COMMAND_0600 INPUT

Hi,
I hope the problem is here,
when 'SAVE'.
IF f1_rec ne 1 .
* if sy-subrc = 0.
* update zfm_handy from fs_temp_zfm_handy.
insert zfm_handy from fs_temp_zfm_handy.
<b>( Here check whether fs_temp_zfm_handy is having the value for the fields nrart and proz1 )</b>
* MODIFY zfm_handy from fs_temp_zfm_handy.
* if sy-subrc = 0.
* insert zfmkstel from fs_temp_zfmkstel.
if sy-subrc = 0.
fs_temp_zfmkstel-telnum = fs_temp_zfm_handy-telnum.
<b>Add
fs_temp_zfmkstel-nrart  = fs_temp_zfm_handy-nrart.
fs_temp_zfmkstel-proz1 = fs_temp_zfm_handy-proz1.</b>
commit work.
INSERT ZFMKSTEL FROM FS_TEMP_ZFMKSTEL.
if sy-subrc = 0.
message s000(0) with 'record havebeen updated successfully'.
* MODIFY ZFMKSTEL FROM FS_TEMP_ZFMKSTEL.
else.
delete zfm_handy from fs_temp_zfm_handy.
endif.
endif.
else.
update zfm_handy from fs_temp_zfm_handy.
if sy-subrc eq 0.
fs_temp_zfmkstel-telnum = fs_temp_zfm_handy-telnum.
<b>Add
fs_temp_zfmkstel-nrart  = fs_temp_zfm_handy-nrart.
fs_temp_zfmkstel-proz1 = fs_temp_zfm_handy-proz1.</b>
update zfmkstel from fs_temp_zfmkstel.
* if sy-subrc eq 0.
* message s000(0) with 'update sucessfully'.
* endif.
endif.
endif.
* endif.
Try to debug and compare with the table so taht u can figure out exactly where the problem is occuring.

Similar Messages

  • Problem in Table maintenance view

    Hi all,
    i am getting some problem in table maintenance view.
    In my table i have some fields and when i created my table maintenance view , it is created , but when i try  to see it in SM30 its not showing my fields and even i am unable to create a  new entry. when i click
    new entries its going back to the sm30 screen..
    How to go abt it
    please help me

    Hello,
    Have you created the table maintanence view the right way.
    You can get good help from below link: [[http://www.****************/Tutorials/ABAP/TableMaintenance/demo.htm]]
    Also, please check the Delivery Class and Data Browser/Table View Maint. in the Delivery and Maintanence tab of the table.
    Thanks,
    Jayant
    Edited by: Jayant Sahu on Nov 24, 2008 3:00 PM

  • Problem in creating table maintenance generator for 61 fields in table

    Hi Experts,
    I am facing problem in creating a table maintenance genarator for a ZTABLE which has 61 fields
    i am using below details whicle creating the TMG
    in Maintenance screen
    i am giving maintenance type as two step
    Maint screen no overview screen 2
                              single screen        3
    Dialog Data Transport details
    Recording routine    standard recording routine
    but it is giving following error
    screen SAPL<ZTABLE NAME>    0003 could not be generated
    In DYNPFIELD_ATTR mandatory field LINE has no value
    please let me know how to sort out these errors.
    Is there any limit on the number of fields for which we can create table maintenance generetor.
    Thanks a lot in advance
    Sudipto

    Hi Sudipto,
    There is not limit to the number of fields of the Table which can be used in TMG for generation. But, from the usability point of view this will horrible.
    I created a Z table and added 64 fields and was able to generate the TMG with the screens perfectly. So, I guess there should not be any problem.
    Well, have a look at the Function Group. I guess the screen numbers are already used by some other screens. You can set the system to propose freely available screen numbers from the pool.
    Also, check whether proper authorization is assigned or not.
    And if nothing is working, you can degenerate all the generated screens and then can have a new regeneration of it.
    Hope these tips will work.
    Thanks,
    Samantak

  • EVENT problem in Table maintenance generator

    Hello all
                 I m working on 4.6C sytem. I m facing  2 problems in events in table maintenance generator
    (1) I am using 04 event (After deleting records from table)   I have written BREAK-POINT in the Form .....ENDFORM... But the control doesnt stop there , when i select  an existing record and press delete record button? not able to understand  this
    (2) When i implement even t 03( Before deleting records from table) , and select  an existing record and press delete record button . Control successfully Go  to corresponding FORM ...   BREAK-POINT ENDFORM . 
    But now the problem is.. in debuggin i can see the contents in TOTAL table  but when i try to code LOOP at TOTAL ..ENDLOOP...it gives me syntax error saying "  table TOTAL doesnot exists or not defined..but similar field TOTAL_S , TOTAL_M , TOTAL_L  exists.. ???
      how come i can see the same during debugging but cannot code it ?
    Plese help
    Nilesh

    Hi Nilesh,
    (1)  I think the control will stop there after you delete AND save. Not sure about that but give it a try.
    (2) I believe you are trying to access fields inside table TOTAL, is that right?
    Actually you have to declare a work area with your Z table type.
    DATA: w_workarea type ztable.
    LOOP at total.
      w_workarea = total.
    endoop.
    Then you can work with w_workarea.
    Best regards.

  • Problem in Table Maintenance Generator

    Hi All,
    We have a TMG which have 11 fields with below fields as primary key.
    CONTRACT_NO
    ITEM_NO
    PRODUCT
    WAREHOUSE
    VALIDITY_START
    VALIDITY_END
    As per standard , during Change Mode these keys will be disable.
    My requirment is to  enable the VALIDITY_END in change mode also. I have done that  by changing the attribute in SE51(Input Possible).
    Now Problem is When I change the VALIDITY_END and saves it, In TMG it shows message "Data Saved" but when I check the
    database table , Changes not reflected.
    Please help.
    Thanks
    Jitendra

    Hi Jitu,
              I agree this is not the right way to do this. You should keep the following in your key fields. And validity_end as normal field. Use the table maintenance events to make validity_end as a mandatory field. Using this events you can pass error messages to user if they keep it blank.
    CONTRACT_NO
    ITEM_NO
    PRODUCT
    WAREHOUSE
    VALIDITY_START
    Best Regards,
    Tapodipta Khan.

  • Problem with the regeneration of Table Maintenance

    My Scenario is like this.
    I have to add a Long Description with a length of 4000 Charecters. For this I have created in my Z TAble ZINT  INT2  5  and ZZLONG_DESC  LCHR  4000. I have activated the ZTABLE. I have Adjusted & Activated the Database by using Data Base Utility. I have regenerated the Table Maintenance (SM30), here my concern is I am not able to see the ZZLONG_DESC Field for Value Entry. I have seen all other Fields are ready for input, except this field. How do you achieve this.
    What ever I will type in ZZLONG_DESC, when I say SAVE it should be available in ZTABLE.
    How to read the Long TExt for 4000 charecters, is it possible using the Function  Module "READ_TEXT".  Please suggest me.
    Thanks & Regards,
    Sivaram Kandula

    Hi Sivaram,
       Yes, there is a problem with fields of long lengths. But, can I know exactly what type of table maintenance u have generated? Is it a one step or a two step? I suggest you to go ahead with creation of two step table maintenance. Then you will definitely see that in the second screen means, when you click on "New Entries" you should be able to see it. Plz have a try at this and let me know with the update. Hope this should work out.
       Otherwise, better to go with Text table concept. Hope you got it.
    Thanks,
    Adithya K
    SAP Practise.
    Note:  Reward points for the helpful answers.

  • Problem with table maintenance event

    Hi Experts,
    In the table maintenance event 05 for a ztable, I have written logic to validate if few key fields and non key fields are not initial.
    If they are initial,need to throw an error message and it has to stay in the same screen.But right now it grays out the non key field.
    Tried the combination of events 01 and 05 it grays out the key field.
    Please let me know if there are any ways to achieve this without making modifications in the PBO or PAI of the ztable.
    Regards,
    Sridevi

    I have this exact problem, why is this thread 'closed'? Is there an answer provided somewhere?
    I have found a topic which shows an information message, which claims that the data is not saved.
    But it does save the data if you use an information message and blocks non-key fields when using an error message
    so this problem is still open for me.
    Does anybody have a solution?
    Ah an answer was indeed provided in another topic:
    Issuing an Error in Table Maintenance Event
    Edited by: Arno ter Horst on May 5, 2011 4:12 PM

  • Problem with table maintenance generator overview screen

    I added a field in a custom table and then used table maintenance generator to regenerate the table maintenance screen.
    I used 2 step to generate. The problem that I have is the field not displayed in the overview screen though it is visible in the single screen ( ie the second screen).
    I am not sure where the problem is as the field is not visible at all in the table control of overview screen.
    Please help me on this as to what could be the problem.

    Usually it is enough to regenerate both screens and the modules, but sometimes it doesn't pick up all the changes. In that case just delete the maintenance dialog and recreate it. That should do it.
    Regards,
    Michael

  • Problem with table maintenance allowed

    hi,
    here my problem is table is genarated and stored under local object that time i m creating function group is zabc. afterwards i m storing my table in my development class that time it is not possible to change function group in table maintenance genarator plz help me any one knows.
    what is the exact use of table maintenance generator i m using this for ztables and i m going to screen painter i m adjesting the fields.what is the exact use of it.

    Hi,
    1) You may delete the function group assignment and re-assign another one in change mode
    2) The use of table maintenance generator is to provide users with a screen to maintain data in the table. If the data is not going to be populated by any users then there is no need for it. Transactions will automatically populate the data in the background
    3) One can access the maintenance screen by going to SM30 or can assign your own transaction code to access it
    Hope it helps.
    Raj
    Reward points if helpful

  • Table maintenance view problem

    Hi. I'm trying to generate a table maintenance view for a custom table, and I keep getting an error message.  I go into the table maintenance view generator and fill out the fields.  I'm selecting a function group that has ZHR0 as the development class (which is correct).  Then when I click on the create button a screen pops up with the workbench request number.  When I click on the continue button, I get the following error message: "The maintenance object description has no transportable class." If I click for more information, this is what it says to do: "Either assign the maintenance object description for object ZTS_ADJST_REAS to acorrectable development class, or assign the table forthe generation of the maintenance module to a function group with non-correctable development classes."  Apparently the maintenance object description somehow got assigned to temporary class $TMP.  Where do I go to change this? 
    Thanks,
      April King

    Hi April,
    You can use standard program <b>RSWBO052</b> to change the package. Enter the object and mark the checkbox -> Execute -> Place the cursor in the object -> Right click mouse -> Reassign -> Enter new package -> Save.
    or you can go to transaction SE80 -> Select Package -> Enter &TMP -> Hit Enter -> Find your object -> put the cursor and right click -> Other functions -> Object Directory Entry -> Change -> Change the package -> Save.
    Hope this will help.
    Regards,
    Ferry Lianto
    Please reward point if helpful.

  • Problem in table maintenance creation

    Hi I am trying to create a table maint for z table for my project, but it is not allowing, it is giving the message--
    The maintenance object description
    transportable package
    please help.

    Hi,
    Go to SE11 enter table name ->change
    Utilities-> Table Maintenance Generator
    delete the Table maintenance by pressing delete button on menu,
    then start creating it again.
    Enter Auth.Group as &NC&
    Enter function group < some name>
    Maintenance Type -> One step
    Overview screen -> some Number (1 or 2)
    Press create
    enter dev class and save, activate.
    Go to SM 30 and check again.
    Pls reward if help.

  • Problem in updating entries in Table Maintenance of custom table

    Hi Gurus,
    Need help. When I update existing entries in the table maintenance generator, they do not get updated after save. Is there a setting in data dictionary that causes this?

    Just noticed that the field that I'm trying to update is a KEY FIELD.
    Usually, when a table maintenance is generated, key field columns are set to uneditable. But for apparent reason, previous programers set it as editable. Is there a way to edit the Key fields?

  • Table maintenance generator problem

    Hi Experts,
        I a table maintenance  generator I have to check for authorization in plant level before deleting an entry. I have created a routine which is of "03-Before deleting the data displayed". But in that if I read ytable-plant it has null. It doesn't point out which row I have selected. But for updation, it takes the exact row values which I have selected.
       How can I read the line which I have selected.
    Thanks and regards,
    Venkat

    Hello Venat
    It will be very confusing for users if there are deletable and non-deletable entries side by side in your maintenance view. Instead, you should do the AUTH-CHECK at the beginning and restrict the selectable data accordingly. All data that are now displayed can be treated the same way (including DELETION).
    Regards
      Uwe

  • Problem in table maintenance

    Hi Gurus.
    I created one ztable and also table mainenance .
    but in sm30 the table is not showed blank screen is showing. here I am not able to create entries.
    please give me the reply.
    Regards,
    Shashikumar.G

    hi
    good
    SM30 is the tcode used to input the values/User Entries in the dictionary object (table) cretaed in SE11 after creating the tables maintenance generator
    table maintanance Generator is used to manually
    input values using transaction sm30
    follow below steps
    1) go to se11 check table maintanance check box under
    attributes tab
    2) utilities-table maintanance Generator->
    create function group and assign it under
    function group input box.
    also assign authorization group default &NC& .
    3)
    select standard recording routine radio in table
    table mainitainence generator to move table
    contents to quality and production by assigning
    it to request.
    4) select maintaience type as single step.
    5) maintainence screen as system generated numbers
    this dialog box appears when you click on create
    button
    6) save and activate table
    thanks
    mrutyun^

  • How to use the table maintenance events for validating the input entries..?

    Hi,
    I have created a Z table with 6 fields in which all are KEY fields. All are of CHAR type. I have created the Table Maintenance Generator for the same. While maintaining the entries in the table, even though I maintain a blank entry for a field it is saving the entry. But, I don't want that way. All the fields are mandatory in my table. One should enter all the fields. Otherwise it should not allow to save the entry. So, I think it can be done using the Table Maintenance Events. can someone tell me how to use the Table Maintenance Events. and which event to use for my reuqirement and what is the logic to be written.
    Or Is there any other way to solve my problem.
    Please share your inputs. Thanks in advance.
    Best regards,
    paddu.

    In the table maintenance generator, Environment --> Modifications --> Events then a screen will be appear here,we need to create the Events.In the EVENTS screen, press new Entries, there give 01(Before Saving the Data in the Database) and give a name(This will become a PERFORM), then click the Editor pushbutton, this will be there at the right side of the entry, then a popup will be appear, you can create an include program, there inside of the include program write ur code.
    Here is documentation for Event 01(Before Saving the Data in the Database )
    Event 01: Before Saving the Data in the Database
    Use
    This event occurs before new, changed or deleted entries are written to the database. Other activities can be performed, for example:
    hidden entry processing
    fill hidden fields
    flag data to be written to hidden tables after the database change.
    To have the changes saved by the central maintenance dialog routines, SY-SUBRC must be set to 0 at the end of the routine.
    Realization
    This event has no standard routine. The following global data is available for the realization of the user routine:
    internal table TOTAL
    field symbols
    field symbols <ACTION> and <ACTION_TEXT>
    <STATUS>-UPD_FLAG
    If internal table data are to be changed before saving, t he changes should be made in both the internal table TOTAL and in the internal table EXTRACT.
    FORM abc.
    DATA: F_INDEX LIKE SY-TABIX. "Index to note the lines found
    LOOP AT TOTAL.
    IF <ACTION> = desired constant.
    READ TABLE EXTRACT WITH KEY <vim_xtotal_key>.
    IF SY-SUBRC EQ 0.
    F_INDEX = SY-TABIX.
    ELSE.
    CLEAR F_INDX.
    ENDIF.
    (make desired changes to the line TOTAL)
    MODIFY TOTAL.
    CHECK F_INDX GT 0.
    EXTRACT = TOTAL.
    MODIFY EXTRACT INDEX F_INDX.
    ENDIF.
    ENDLOOP.
    SY-SUBRC = 0.
    ENDFORM.
    Regards,
    Joy.

Maybe you are looking for

  • DOWN TO A CRAWL IN SHETLAND AGAIN!!!!!!!!!!!!

    Yet again our broadband speed is at a crawl. When oh when is BT going to get a flipping grip and get the infrastructure sorted in Shetland so we can get reliable high speed broadband? Which, I might add, is what I'm supposedly PAYING FOR. Speedtester

  • Gantt Chart in P6 Analytics - OBIEE

    If you search the web, Oracle KB etc. you may find that Gantt Charts are not supported currently in Analytics. There is however a way to create a basic gantt in OBIEE. Step 1: Create a new analysis using the 'Activity' Subject Area. Step 2: In the Cr

  • Create customer master

    Hi Gurus, I have a requirement to create customer,i have used the following bapis but cudnt help o create. but tried all the bapis like : /SAPNEA/SMAPI_CUSTOMER_CREATE2 /SAPNEA/SMAPI_CUSTOMER_CREATE BAPI_CUSTOMER_CREATEFROMDATA1 BAPI_CUSTOMER_CREATEF

  • Topology creation in standard edition of oracle

    I am creating topology in standard edition of oracle and getting error Please suggest SQL> EXECUTE SDO_TOPO.ADD_TOPO_GEOMETRY_LAYER('city_data1','LAND_PARCELS1','FEATURE','POLYGON'); BEGIN SDO_TOPO.ADD_TOPO_GEOMETRY_LAYER('city_data1','LAND_PARCELS1'

  • Lightroom Files missing after new drive added

    I recently filled up my old hard drive(F:) so I went out and bought a new and larger one. Without realizing it the new one was now the F drive and my old one is now the H drive. But Lightroom can not find all of my files in my old drive and I think i