‎2005 May 03 12:02 PM
Howdy,
Could you help with the following please?
I have created the following Z-table:
<b>Field | Field Type| Data Type| Length| Check table|Short Text</b>
MANDT| MANDT | CLNT | 3 | T000 | Client
VKORG| VKORG | CHAR | 4 | TVKO | Sales organization
VKBUR | VKBUR | CHAR | 4 | TVBUR | Sales office
VKGRP | VKGRP | CHAR | 3 | TVKGR | Sales group
SECTOR| ZSECTOR| CHAR | 6 | | Sector Codes
I have then set-up one step table maintenace and the user can now go in and add delete entries to the table via SM30 - great so far
But oh no! The user now realises what they would really like
They've said:
<b>Please can you make the sales grp dependant on the sales office and the sales office dependant on the sales org - so that only relevant entries are displayed - this is how it is in the customer master - see sales data view and orders screen.</b>
Now is sounds like that they want me to vlaidate the entries that they enter for the Sales Area, but how would I do that? Does anyone have any ideas? Please help if you can and let me know if you need any more information from me...
Thanks!
P.S> If I wanted to transport the contents of theis table would I need to change the attributes->delivery class to 'A'? It is currently set to 'C'.
‎2005 May 03 12:41 PM
Hi,
In SE11 for that table , Go to->Table Maintenance->and then generate Table Maintenance.While generating it you need to give a function group for that.In that,go to that main program.Then uncomment the PBO option.Then write your own validations there.
Hope this is clear.
If not,get back to me.
‎2005 May 03 12:41 PM
Hi,
In SE11 for that table , Go to->Table Maintenance->and then generate Table Maintenance.While generating it you need to give a function group for that.In that,go to that main program.Then uncomment the PBO option.Then write your own validations there.
Hope this is clear.
If not,get back to me.
‎2005 May 03 12:53 PM
Do remember whenever you regenerate the table maintenance screen, your changes will be gone too. Creating your own module pool with validation etc won't take a day IMO.
‎2005 May 03 12:58 PM
I must agree with Misnan in that creating a separate transaction is a better idea. It should take you no more than an hour.
‎2005 May 03 1:49 PM
Hello all,
but you can include all your coding -
so that you've only to insert your includes to the module
pool, if you've to regenerate it.
regards Andreas
‎2005 May 03 2:14 PM
Have look in to Cardinality of a relationship, with respective check tables.
Might help you.
Manohar
‎2005 May 03 2:58 PM
Howdy Jayanthi,
Thanks for the tip.
Unfortunately I've done what you siad and I've ut in a breakpoint and the code won't stop there?
Additionally I wrote an error message that should be displayed and again this this is not displayed?
Also when uncommenting the PBO in the function module I had to add '00' onto the end of the name or the program would not compile.
Is there something that I am missing?
‎2005 May 04 5:30 AM
Hi Steve,
Uncomment the PBO and PAI like this.
INCLUDE LZCSI_CAPIPRO<b>01</b>. " PBO-Modules
INCLUDE LZCSI_CAPIPRI<b>01</b>. " PAI-Modules
Then in the PAI of the screen(While creating Table Maintenance), write like this.
MODULE detail_set_pfstatus.
CHAIN.
FIELD zcs_exp_ipr_fact-bukrs .
....
MODULE set_update_flag ON CHAIN-REQUEST.
* Start of insert
<b>MODULE zcs_exp_ipr_fact_valid.</b>
* End of insert
ENDCHAIN.Then in the PAI which we uncommented earlier ,
write the required as below.
MODULE zcs_exp_ipr_fact_valid INPUT.
IF zcs_exp_ipr_fact-bukrs IS INITIAL.
<b>SET CURSOR FIELD 'ZCS_EXP_IPR_FACT-BUKRS'.</b>
break username.
MESSAGE e091(zcs_p2p_001)."Enter Company code
ENDIF.
ENDMODULE. " zcs_exp_ipr_fact_valid INPUTHope this is clear.If not,get back to me.
Rgds,
J.Jayanthi
‎2005 May 03 2:52 PM
Hi Steve,
coming back to the question of value checks:
use table TVKBZ as check table for VKBUR and table
TVBVK as check table for VKGRP. Maybe your Z-table needs distribution channel and division in addition, maybe you can maintain default values in check table definition - depends on your enterprise structure.
Any additional coding for SM30 isn't needed (IMHO).
Regards,
Christian
‎2005 May 03 5:15 PM
Howdy CHristian,
I've already added value check tables if you have a closer look at my original post you may see the tables I have used.
The problem is that the user's want a more thorough check like the one in VA01 where all corresponding sales office/Group/org combinations can be assigned to each other.
Would your check tables take account of this? If so you've solved my problem!
‎2005 May 03 6:49 PM
Yes! Just need to find the right check table for the scenario, there are a few more tables available, look at the tables VBAK, LIKP, LIPS, VBRP, VBRK foir the check tables used there and you should find your solution.
I also suggest awarding Christian some points.
Rishi
‎2005 May 03 8:45 PM
Hi Steve,
Changing the check tables as suggested by Christian should solve your problem, even though it will give you a message "Foreign Key cannot be specified in full", but you can ignore it or use constant values as suggested by Christian.
Change your table as follows
Field | Field Type| Data Type| Length| Check table|Short Text
MANDT | MANDT | CLNT | 3 | T000 | Client
VKORG | VKORG | CHAR | 4 | TVKBZ | Sales organization
VKBUR | VKBUR | CHAR | 4 | TVKBZ | Sales office
VKGRP | VKGRP | CHAR | 3 | TVBVK | Sales group
SECTOR| ZSECTOR | CHAR | 6 | | Sector Codes
This should take care of it. If not, you can use events to have your own validations. Go to SE54, enter your table name and choose the menu option 'Environment-->Events'. In the next screen, create new entries and choose event 01 and give a name for the routine. Using the Editor button for that row, you can insert your validation logic there.
Hope this helps,
Srinivas
‎2005 May 04 6:08 AM
Hi Steve,
I took the tables out of customizing (SPRO):
Enterprise Structure->Assignment->Sales and Distribution->Assign sales office to sales area
Enterprise Structure->Assignment->Sales and Distribution->Assign sales group to sales office
I can't imagine, which connection could be more specific / sophisticated - that's exactly the way of SAP's definition.
So this should be alright for your customer.
Regards,
Christian