Dynamic Check boxes in a Step Loop

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Posts: 41
Joined: Thu Oct 31, 2002 5:26 pm
Location: USA

Dynamic Check boxes in a Step Loop

Post by Chual » Thu Oct 31, 2002 5:36 pm

Hi all..

In the Material Master selection view screen ( The pop up screen after entering the material number in MM02 or MM03) , I need to check few check boxes for my BDC. The problem is the position of the check boxes are dynamic. So I can't hard code the position number in Step-loop MSICHTAUSW-KZSEL. How can I find the position number based on the text associated to it ? For example how do I find out the current position of the 'Accounting 1' screen in the view list for a material?

SAP ver: 40B.

Thank you.


Posts: 32
Joined: Mon Oct 21, 2002 11:01 am
Location: Boston, USA

Post by Chaps » Thu Oct 31, 2002 6:11 pm

Hi Chual,

The table T133B contains the sequence of the screens for MatMast. The table USRM2 contains the user-specific settings for the screens.

Hope this helps.
"Skill is fine, and genius is splendid, but right contacts are more valuable than either. "
--Archibald McIndoe


Post by Guest » Fri Nov 01, 2002 10:44 am

Hi Chaps,

Thanks a lot for the reply.... But how do I use those tables for any specific material ? Each material has a different set of screens. For Ex: How do I know what is the position of 'MRP 1' for material 100 ?




Post by abapkid » Fri Nov 01, 2002 11:10 am

hey there,
for the Material Master BDC u can select the Basic data1 always and the when the basic data is selected u can code in the BDC,BDC_OKCODE '=SP02' and so on.So immaterial how many views the material has,for eg.if u want to reach the MRP1 view u can use BDC_OKCODE '=SP12',which will take you the MRP1 view after basic data view.

so u got ur answer,relax and enjoy abapping,its a wonderful stuff to work with.


Post by Guest » Fri Nov 01, 2002 11:34 am

Hi abapkid,

I really didn't understand how you got BDC_CODE SP12 for MRP 1 view? I want only one view for my BDC . Let's say I want only MRP 1 view, how do I get the BDC_CODE for that view for a Specific material ? The MRP 1 screen can be No. 12 for material 100 and No 15 for material 101.

Hope, I am making myself clear .




Post by abapkid » Fri Nov 01, 2002 11:51 am

hey Chual,
Actually its always fixed whatever the material is,maybe 10 or 100 or 1000,bcoz the system is defined so.to be more precise,the BDC_OkCODE for basic data1 is always '=SP01' and is incremented by one for the following views and as the MRP1 view lies in the 12th check box,its BDC_okcode is '=SP12'. so whether the material has 5 views or 10 views,if it has a MRP1 view defined use the code '=SP12' it will call the MRP1 view.Chual suggest u to try it on the system and u will see it for urself.Its better u ask few questions and explore it using those few hints which will help u in the longer run,a friendly piece of suggestion.

hope things have been made clear

have fun.


Post by Guest » Fri Nov 01, 2002 12:32 pm


Thanks for your reply and suggestion. The problem is MRP 1 is not the 12th check box in our case. For some material is it 11, for some it is 14 and for others is 15 or 16. Then how come the BDC_OKCODE SP12 becomes constant irerespective of no. of views. ? If you say if MRP 1 is defined then use SP12, then how will I determine the OKCODE for 'Accounting 1' screen, where for some material it is the 18th check box , for others it may be 19th or 21st.

There got to be a table in SAP where the all the views must be defined with the asscociated text.


Post by abapkid » Fri Nov 01, 2002 1:33 pm

Oh Boy :lol: :!: :!: ,
ok here we go,try creating a new material,just go to MM01 enter the material number and details and press enter,now u get the dialog box with all the views ok,now start counting which view u need,maybe MRP1,or MRP2 or Accounting or costing,then determine where it is placed and then with the count add =SP and do ur coding ok.hope u dont make things too complex searching for table which contains views and stuff like that,comes out of experience :wink: .
if u r still demanding maybe some one cud help u find the table :roll: .


Post by Guest » Fri Nov 01, 2002 1:42 pm

If you look at mara-pstat, this tells you what views the material has or you can look at table MOFF.
Then do this
SET PARAMETER ID 'MXX' FIELD 'V'. (V = Sales) Change the value
to the view you want.

Hope this helps.



Post by Guest » Fri Nov 01, 2002 1:49 pm

OH DEAR abapkid...

That is how the whole problem started. And I mentioned that clearly in my original first question. I DO NOT want to hard code the position number. Because they are dynamic. As of now it is hard coded, the way you have been thinking. THE PROBLEM IS the business keep adding and deleting views to the material master everytime which breaks the hard coded number. Again, its is definitely not a good idea to hard code for each of 10000 material the BDC is written. I want to know find those number dynamically.

As you said, its fun doing ABAP....

Thank you



Post by Guest » Fri Nov 01, 2002 3:38 pm

Hi Jeff,

Your idea looks good.. Could you please explain how to use the SET PARAMETER in this case ? All I can see in the MARA-PSTAT are two different vaues for most of our materials. How will I use that in the SET PARAMETER ID .... What do you have as MXXX and what is V....

I would appreciate if you explain it in little more detail....




Post by abapkid » Fri Nov 01, 2002 4:31 pm

I am sorry :wink: i didnt get ur question properly.yes you could use the MARA-PSTAT and use the FM: SELECTION_VIEWS_FIND and use BILDSEQUENZ = 21 and PFLEGESTATUS = MARA-PSTAT.

then the internal table BILDTAB will have the views active for the material and the 'SP.....' series which can used for the BDC_OKCODE and with the description of the view.

hope this time I got it right :wink:.

have fun with ABAP :) .


Post by Guest » Fri Nov 01, 2002 5:09 pm

GREAT !! Dude. YOU GOT IT.... This is exactly what I was looking for... THANKS A LOT .........

Btw, Where did you get the 21 value from?? ... I know that works... But can't understand where it is coming from....

Thanks ,