Help req for check customer table maintenance with XD02 if not throw error

hello ABAP GURUS,
check customer of the table maintenance with XD02 if not throw error i have given the codition for passing the values in the table but before that it has to check whether the customer i am passing in to the table is a customer from xd02.Here whatever no i am passing it is accepting it should not happen, but when i give the customer which is not a customer it should not accept but it has to throw the message as 'customer does not exist.Its urgent please help me
TYPES: BEGIN OF TY_KNVI,
KUNNR TYPE KUNNR,
TATYP TYPE TATYP,
TAXKD TYPE TAKLD,
END OF TY_KNVI.
DATA : VALIDFROM TYPE GUEBG,
VALIDTO TYPE GUEEN.
DATA : IT_KNVI TYPE STANDARD TABLE OF TY_KNVI,
WA_KNVI TYPE TY_KNVI OCCURS 0 WITH HEADER LINE.
DATA : V_NAME TYPE SYUNAME.
SELECT KUNNR
TATYP
TAXKD
FROM KNVI
INTO TABLE WA_KNVI
WHERE KUNNR = YYV_CFORM-KUNNR
AND TATYP = 'ZCST'
AND TAXKD = '1'.
V_NAME = SY-UNAME.
YYV_CFORM-ENTEREDBY = V_NAME.
IF SY-SUBRC NE 0.
MESSAGE E000(E4) WITH 'Please change the tax classification of ZCST as' '1' ', in Sales Area Data'.
ENDIF.
I have used the following code to enter the data into the table maintenance it is working fine and throwing the error when the tax type is not the one which i have given in the select statements but the problem is when i have given the customer no which is not there in the XD02 tcode, it is accepting and showing the error message as MESSAGE E000(E4) WITH 'Please change the tax classification of ZCST as' '1' ', in Sales Area Data'. now i have to check the customer no from XD02 and if it is existing in that tcode it should allow to save in the table maintenance otherwise throw a message as the 'Customer no does not exist, this I am unable to write so how can i check please help me .
thankx in advance.
Edited by: soni khadary on Apr 22, 2008 7:55 AM

Hi Kelly,
I guess <wa_tab>-handle_style is of type lvc_t_styl therefore you can do the following:
ls_edit-style = cl_gui_alv_grid=>mc_style_enabled.
"I assume you know your non-key fields' names so you can use subrotuine to perform update on each of them
ls_edit-fieldname =  'First field name' .
PERFORM update ls_edit.
ls_edit-fieldname =  'Second field name'.
PERFORM update ls_edit.
ls_edit-fieldname = 'Third field name'.
PERFORM update ls_edit
FORM update USING fs_edit type lvc_s_styl.
field-symbols: <style_tab> type lvc_t_styl,
                     <style_wa> type lvc_s_styl.
LOOP AT <tab> ASSIGNING <wa_tab>.
   if e_row = sy-tabix .
     "get you style table
     assign component 'HANDLE_STYLE' of structure <wa_tab> to <style_tab>.
     "as <style_tab> is typed fully you can read the row you are interested in
     read table <style_tab> assigning <style_wa> with key fieldname = fs_edit-fieldname
     if sy-subrc = 0.
       "update this entry
        <style_wa> = fs_edit.
*        modify table <style_tab> from <style_wa>. 
     endif.
   endif.
endloop.
endform.
Note!
Though, this should work, the use of RTTI as Uwe suggested would be best practise approach as far as dynamic programming is concerned. Anyhow it is still up to you which one you pick.
Regards
Marcin
I noticed now that this line is not necessary
modify table <style_tab> from <style_wa>. 
as we simply are working with field symbols, so changes made to <style_wa> are already visible in that table <style_tab>.
Edited by: Marcin Pciak on Mar 15, 2009 12:44 PM

Similar Messages

  • Can you please help me with validation logic for Events in Table maintenance generator

    Can you please help me with validation logic for Events in Table maintenance generator,i.e if i enter record in 1st internal table then automatically 2nd internal table should be updated.

    Hi Glen Anthony,
        Thanks for replay,
         I used foreign key relationship between those 2 internal tables....
    I used event 05: When creating a new entry. I want to know the custom logic by which my 2nd Internal table gets automatically updated when i update my 1st Internal table
    Thanks Glen.

  • HELP NEEDED: Use a new record for a customized table as a workflow trigger

    Hi SAP Workflow Gurus,
    Good day!
    One of our requirements is to have the creation of a new record in a custom database table trigger a workflow. I read and followed the steps as indicated in this link
    http://www.****************/Tutorials/Workflow/Table/events.htm
    As a summary, here is what I did:
    1. Created a subroutine for the custom table ZPA2003 for the create event
    2. Defined this event as a trigger for the custom workflow WS90000019
    3. Maintained and activated the event linkage via SWETYPV
    Basically I tried following the instructions indicated on the link
    Note that the entries for the custom table are created via a function module.
    Now during testing of the workflow, the system was able to complete the notification message. However, when I triggered the event via creation of the entry in the custom db table nothing happened
    1. Is there a way to debug/find out whether the link between the subroutine in the table and event itself are connected?
    2. I also tried running the event trace to check the activities executed but found nothing.
    Can you guys help me check on what I may have missed out?
    Regards,

    Hi All,
    Basically these are the requirements for the work schedule substitution:
    1. Employee enters the request via ESS (custom portal transaction)
    2. Upon saving of the entry (request) in a custom  table, this should trigger the workflow at the backend
    3. The Manager should then receive a work item in his Universal Worklist at the MSS side of the portal
    4. Upon clicking on the work item, a new screen will pop up showing the work schedule substitution details as well as an interface which will allow him to enter his/her usage decision
    5. Depending on the decision, the workflow must execute the necessary notifications as well as changes in the custom and PA2003 tables
    Now, we have accomplished step 1 and I am currently in the process for step 2. Now I have some queries:
    1. For the Manager to view and approve the substitution details, I used two methods for each process (view and approve) since our ABAPer mentioned that this cannot be done in 1 function module. Is there a way to simplify this step or is it really valid that they need to be executed in 2 different methods?
    2. As per our ABAPer, function Modules only import and export variables; they do not have the facility of say having tags on the details being displayed. Hence, if the details are 10001 (Employee Number), 10/20/2011 (Start Date), 10/25/2011 (End Date) the output would be 10001, 10/20/2011, 10/25/2011. Is there a way within the function module (or dynpro interface) to show it like this: Employee Number: 10001
                               Start Date: 10/20/2011
                               End Date: 10/25/2011
    3.  Speaking of dynpro applications, do I need to still develop one to allow the Manager to view and approve/reject the request via the MSS portal upon accessing the work item via the UWL? How would the work item go about calling the dynpro application? or is this even possible?
    It would have been easier if the facility would not pass through workflows since it will be just direct web dynpro/ABAP calls. Having to include it as a work item in the UWL puts a certain twist to it
    Your inputs are well-appreciated.
    Regards,

  • How to create a help view for a customized error message

    Hi all,
    Can you guide me how to create a help view for a customized error message, we need to put some suggestions in it so that user can can resolve this issue with this guide. ( the short text is too short to describe all situations via TC:SE91)
    Thanks very much!
    Bruce, Wen

    Hi Bruce,
    Could you brief your concerns again.
    Why don't you maintain long text in message class for long description.
    Regards,
    Ranjith N

  • Creating 2 table maintainance views for one custom table

    Hello All,
    I want to create 2 table maintainace views for one custom table.
    I know how to create table maintainace but I want to know whether we can create only one maintainance view or we cal also create 2 maintainace views for a single custom table.
    Regards
    Mahesh

    Hello,
    You can create as many maintenance views one one table as you want.
    Kind regards,
    Bart

  • User Audit Trail for a custom table.

    Hello all. I need to know the correct and accurate way to user audit for a custom table. To elaborate further, I have a table catering to sanctioned strength of employees in a particular Cost Center, the entries have been deleted all together by someone, and I need to know the way to recover the data and to identify the user in question. Note, I have used STAT and have foundno results, and standard user audit trail are turned off.
    Any help or push in the right direction would be highly appreciated.
    P.S: any additional technical details on the table structure can be provided for further analysis if needed.

    Try to add your custom table and table fields in the below views
    V_T585A
    V_T585B
    V_T585C
    After doing this your custom table changes gets stored in the pcl4 document . If the custom table  is master data table  then from the standard Audit trail report you can see the logged changes in custom table also by providing the custom infotype number.
    if its is custom customizing table , need to explore

  • How to find Transaction for a Known Table maintenance View

    Hello Friends,
    May I know how to find transaction for a known table maintenance View.
    Thanks,
    Best Regards,
    Sudhanshu Garg

    Goto SE16 Transaction and enter TSTCP Table
    Here PARAM = /SM30 VIEWNAME=Table name*;UPDATE=X;
    enter table name in bold.
    Thanks
    Seshu

  • How to create a authority group for our customer table(se54)?

    Hi,everyone:
          I found a problem when I create a authority group for my customer table,I can't write the creation
    to a request no(can't assign to a package),I want to know whether the authority group I created can be
    transport to the PRD when I realse the request no.
    Thanks!!!

    Auth Group is nothing but a table entry so for sure it can be transported to any environment, before Assigning any Auth group create one in SE54 when you try saving it it would ask you the TR number which you can transport to PROD.

  • With 3.6.12, Help menu item "For Internet Explorer Users" results in a "Page Not Found" error. Is this a known bug? Is it being addressed?

    Clicking the 3.6.12 Help menu item "For Internet Explorers" item results in a "Page Not Found" error.
    The URL of the resultant page is https://support.mozilla.com/en-US/kb/Windows%20start%20page?as=u
    Is this a known bug, if so, is it being addressed? If so, someone needs to work faster.
    If it is not a known bug, someone needs to get right on it - you want people to switch to Firefox and then there is this bug -- not a good way to impress Internet Explorer users.

    Hi Claudio Roca,
    I have encountered the same problem. Do you found the solution for this issue? I will much appreciated if you willing to share your solution and email to [email protected] Thank you so much.
    Regards,
    Hau Chee

  • I use google with firefox, everytime i open firefox and begin browsing or go to check my mail i get a firefox not responding error message on top left of screen. How do i get rid of this?

    Question
    I use google with firefox, everytime i open firefox and begin browsing or go to check my mail i get a firefox not responding error message on top left of screen. How do i get rid of this?

    Hi,
    Please check if this happens in [https://support.mozilla.com/en-US/kb/Safe%20Mode Safe Mode.]
    [http://kb.mozillazine.org/Problematic_extensions Problematic Extensions]
    [https://support.mozilla.com/en-US/kb/Troubleshooting%20extensions%20and%20themes Troubleshooting Extensions and Themes]
    [http://support.mozilla.com/en-US/kb/Uninstalling+add-ons Uninstalling Add-ons]
    [http://kb.mozillazine.org/Uninstalling_toolbars Uninstalling Toolbars]

  • BPM_DATA_COLLECTION fails with (Output device "" not known) error

    Hi all,
    I have an issue with Output BPM_DATA_COLLECTION_1 job in the satellite system  failing with 'Output device "" not known error.  Since it is collecting data for Solution Manager system why does is it trying to find an output device.
    It did not fail before and now I added another key figure (custom one) which is done the same way the other custom monitors are done in "Z_BPM_ECU_COLLECTOR" report and then in /SSA/EXM program, but the collector job started to fail.
    Also, for some reason there are two BPM_DATA_COLLECTION jobs, one is BPM_DATA_COLLECTION_1 and the other is BPM_DATA_COLLECTION_2.  _1 runs every 5 min and _2 is less frequent. They both seem to runt the same job which is /SSA/EXS. Why are there two jobs scheduled from solution manager in my satellite system?
    Thank you very much for your help!

    I am experiencing this same issue in our ECC 6.0 system.  We currently have ST-A/PI release 01M_ECC600 level 0001 applied to our system.  These jobs finish successfully in SM37, but I'm seeing the same error messages in our system logs (SM21).
    When I try to update the output device that is associated with these jobs, the user ID running the jobs is not valid since it's user type is Communication Data.
    Does anyone know if it ok to change the user for this job? Should it be run by DDIC?  I believe the jobs were created automatically when we applied ST-A/PI release 01M_ECC600 level 0001.

  • Object variable or With block variable not set error message

    When processing the Rate application I get a "Object variable or With block variable not set error message" What is causing this error and how do I fix it?

    Hi Brian,
    I'm afraid that in some ways this reply won't be very helpful though it may help you save some time. 
    The error message you describe is a very generic one thrown by Microsoft .NET (the programming platform that SAP is written with, see the link at the bottom of this message) and not being 'handled' by SAP. 
    This means from a SAP perspective that any one of many unrelated things may be causing the error and that it gives you virtually no help in tracking the problem down in SAP.
    We've plagued by this message quite a bit, my advice is to look for clues at to what may be happening elsewhere, e.g. try:
    1. The windows event viewer, if you are in a multi-server environment then check the event log on all machines.
    2. The SQL Server event log (this can be found in Management Studio - Management - SQL Server Logs assuming you're using SQL Server 2005)
    3. IIS logs, usually these are text files in the following location -
    HTTP.SYS Error Log - %windir%\System32\LogFiles\HTTPERR
    IIS Website Log - %windir%\System32\LogFiles\W3SVC#
    It is dull work trawling through all these places looking for error events with a timestamp similar to the time your error was encountered, but by doing this we've been able to troubleshoot some issues that otherwise would have taken us ages to rectify via trial and error.
    Sorry that there is no definitive answer, but if itu2019s of any help there's many more of us out there who this error message causes trouble for.
    Regards,
    Iain
    Microsoft "Object variable or With block variable not set" error message link:
    http://support.microsoft.com/kb/316478

  • "Object Variable or With Block Variable not set" Error on Adobe Presenter 8 Ribbon on PPT 2010/2007

    Returning back from Adobe training at KEDRIYA VIDYALAYA no 1  Jalhalli Bangalore when I started Powerpoint to use Adobe Presenter 8  I am getting : "Object Variable or With Block Variable not set " error on clicking any of the menu features of the Presenter Ribbon. My Config are :
    i)             WINDOWS XP SP 3
    ii)            POWERPOINT 2007 / 2010 ( for both same error is coming)
    iii)           MS XML Library 4.0 installed.
    iv)           Adobe Presenter 8
    I am using all liscenced copies of softwares.
    Hardware specs are also as per Minimum Adobe standards.
    I Have tried a lot removing Data Execution Prevention Mode , but all in vain the problem still exists
    Why is this happening. Please help.
    Kamal K Gupta
    PGT Comp. SC.
    KV No. 2 Srivijaya nagar

    This is not really a "Downloading, Installing, Setting Up" question; you may get better help if you ask in the Presenter forum.

  • Object variable or With block variable not set (Error 91)

    I am not a developer, however i have to help to run a VB program.
    when using a local administrator to run this program there will be error :
    Object variable or With block variable not set (Error 91)
    however using a DOMAIN Administrator to run without problem.
    any idea

    Do you have the source code? The error itself is a nullreference error. It means the code is trying to use some object to access a property of method of that object, but the object is currently null so it fails. The fact that it runs different when you run
    as a domain admin versus local admin could mean that it does something via a network location or resource, and when running as a domain admin, it has access to that resource and succeeds, but the local admin doesn't have access to the needed resource, and
    the code doesn't check to see if the object is null before using it. If you don't have the source code, then it will be difficult to fix, other than giving the local admin the ability to access whatever it is the program is looking to access.
    Matt Kleinwaks - MSMVP MSDN Forums Moderator - www.zerosandtheone.com

  • Table maintenance generator for a custom table

    Hi All,
    I have a requirement.
    I had created a custom table with 5 fields with partner_id as the key field.
    I had generated the table maintenance for this.
    But, when i maintain via sm30, the maintenance screen should display 7 fields, i.e
    for the partnerid, the firstname and the lastname has to be display as the second and third column.
    So, in the maintnenace screen sm30, i should have 7 fields display... but actually in real custom table, there will be only five fields (except firstname and lastname of partner).
    Please guide me how to do this development.
    Do i need to change the code generated via table maintenance and add these two fields in the table control and code to retreive the values for the firstname and lastname.
    Please help me.
    Thanks,
    Jaffer ali.S

    it is not a wise idea to add your custom fields in standard sap table maintenance generator screens..
    each time you do a re - generate, (in case you added a new field in the table, or changed a data element, ) you will have to regenerate your tabe maintenance generator, and you will lose your code...
    in this case, it will be better to create a custom screen with these fields and write code to populate the table..
    or to make it easy, create a maintenance view with all fields required,

Maybe you are looking for