Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Insert data using bdcdata but block input

former_member397321
Participant
0 Kudos

Hi experts, wish you good health.

Need your help:

I have done a report program which call a pool program by call transaction. So at the beginning  I fill the screen of that called transaction using BDCDATA, and I want to block input for some fields of the screen.

I tried to put those fields I need to block the input in the same group and in the init module of the screen I have implemented- screen-input = 0. So when I do it the BDCDATA couldn't/ doesn't fill the fields.

When I perform those fields, by checking only output Data, in the screen painter-attributes, the BDC data couldn't work too.

What I need is that the displaying field work, like it work in a report when I initialize field by value and perform this code below,

AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.

    IF screen-group1 = '901'.

      screen-input = 0.

      MODIFY SCREEN.

    ENDIF.

ENDLOOP.

The ield values displayed, but I'm not able to edit/change it, it's displayed only, for output(for seeing)

Sory if it is not relevant.

My thank for you all who will be able to help.

4 REPLIES 4

former_member212124
Active Participant
0 Kudos

Hi Elina,

I think I did not get your requirement completely.

But I can see that you want to enable and disable editing(input fields) based on your requirement. Right?

If yes, then try to use a condition flag which you have to set based on your requirement.

Example code.

  LOOP AT SCREEN.

if   lv_condtion_flag = 'X'.

    IF screen-group1 = '901'.

      screen-input = 0.

      MODIFY SCREEN.

    ENDIF.

else.

    IF screen-group1 = '901'.

      screen-input = 1.

      MODIFY SCREEN.

    ENDIF.

endif.

ENDLOOP.

This above code enables and disables editing of input fields based on value

in lv_condition_flag(type boolean).

Please ask if your requirement differs from my understanding.

thanks,

vidyasagar

former_member289261
Active Contributor
0 Kudos

Hi,

Sorry but you cannot change attribute of a field using BDC.

What you can do is, in the PBO of the screen, write a logic that if the field value is not initial then input = 0.

Assign an function code to some key combination like ENTER key but do not add any code for it.

So, while recording BDC, press enter after filling in the fields, which will trigger the PAI and PBO of the screen thus the logic for disabling field when it has value will run and the field will get disabled.

former_member195402
Active Contributor
0 Kudos

Hi Elina,

you can check on field SY-CALLD for the condition to activate input on this field-group.

Regards,

Klaus

Former Member
0 Kudos

Hi,

Are those fields(to be kept disabled) fixed/static? Or do they change according to data.

If static, you can use "transaction variants" for your transaction and hide those fields through transaction variants. -Please search on net as to how to use txn variants.

Now say the original transaction is XYZ, you create ZXYZ with txn variants.

In BDC call, call txn ZXYZ(where the fields are statically disabled)

otherwise call XYZ as required.

-Sumit