2015 Jan 06 2:57 PM
Hello Guys,
Can anyone help me to figure out in coding whether any field is present or not in a particular Screen Number During BDC.
Thanks in Advance.
2015 Jan 06 3:19 PM
Well, if you know the screen number, you should know what fields are present.
But some may be inactive or hidden based on configuration or other conditions. The only way I know of is to test out all of the possibilities that you may encounter.
A better solution is to use a BAPI or standard SAP program if available.
Rob
2015 Jan 06 3:46 PM
I will try to understand from other perspective.
Why do you want to know all the fields in a screen during BDC?
I assume the answer is, so that relevant data can be passed in that screen-field.
As per my understanding, if you do BDC recording using transaction SHDB, it will capture all the screen-fields.
Warm Regards,
Shyam Agrawal
2015 Jan 06 3:50 PM
That works for simple cases where the same screens always occur in the same order. But many complex transactions (FB01 for example) have different screens coming based on different conditions.
Rob
2015 Jan 06 5:01 PM
A BDC is one-way communication - you send your requests to the BDC, but you cannot "ask it questions" along the way. Kindof like throwing a bucket over a tall fence - you know what is "typically" on the other side, but not what is there for this exact run. If there are fields which appear based on configuration or some other data, you will need to programatically check this yourself before executing the BDC. If a fields visibility is dependent on the status of something, then you will need to check that status to determine if the field will be available to you.
You need to be as specific as possible, do not assume you will end up on a particular screen for the desired item, explicitly go to that screen for that specific item. It's alot like throwing darts behind your back, you are making your best guess as to what will be shown on the screen at run-time. You will need to check for special cases and data irregularities which could alter what appears on the screen.
BDC programming is not for the faint of heart