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: 

how to know when the batch input is finished

Former Member
0 Kudos

Hi all,

We have the following scenario:

We have a programa wich call to a transaction using a batch input. Both are custom programs.

The batch input fills some data and skip some screens and then returns the control to the user.

We are calling the batch input with these options:

opt-dismode  = 'E'.

opt-updmode  = 'S'.

opt-racommit = 'X'.

The problem is when the batch input is filling these values several fields must be in edit mode, but when the batch input ends and the user recover the control these same fields must be in non editable mode. We don't want the user can change the values of these fields.

But we don't know when the batch input is finished. we've tried checking the value of sy-binpt and sy-batch,but sy-binpt is always set to X and sy-batch is always set to SPACE.

We need to do it in the PBO of the screen, and we need to know the "dismode" to change the logic in the LOOP AT SCREEN.

If we put these fields always as non-editable the batch input doesn't work because can't change the value of these fields...

Do you know how can we achieve it?

Thanks in advance,

Regards.

Pedro.

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

Try to use OPT-NOBIEND = 'X' and keep OPT-NOBINPT initial (Read OPTIONS FROM opt )

Regards,

Raymond


10 REPLIES 10

raymond_giuseppi
Active Contributor
0 Kudos

Try to use OPT-NOBIEND = 'X' and keep OPT-NOBINPT initial (Read OPTIONS FROM opt )

Regards,

Raymond


0 Kudos

Hi Raymond,

Thanks for reply.

We've tried to use these options, but the value of sy-binpt is still being 'X' after the batch input.

We've tried with

  gt_opt-nobinpt = space.

  gt_opt-nobiend = 'X'.

and also with;

  gt_opt-nobinpt = 'X'.

  gt_opt-nobiend = 'X'.

But nothing, the value doesn't change.

Any other idea?

Thanks.

0 Kudos

Strange, with gt_opt-nobinpt = 'X'. the sy-binpt should be initial even during execution of the batch input.

Also you set opt-dismode  = 'E', why, did you raise an error ?

Regards,

Raymond

0 Kudos

Hi Rayman,

We're using the dismode = 'E' beacuse we need to skip some screens and then continue in the transaction. We've tried with other modes like 'A' , 'N' or 'P' but for this purpose doesn't work.

We need to check sy-binpt while we are still in the transaction, may be these options are for when you return from the CALL TRANSACTION. 

0 Kudos

OPT-NOBIEND = 'X' in CALL TRANSACTION ... OPTIONS FROM opt should allow the transaction to continue with user interaction after the end of the BDCDATA. Can you post the code of your CALL TRANSACTION ?

Regards,

Raymond

0 Kudos

Hi Raymond,

I don't know what were doing wrong but now is working. This is the code of the CALL TRANSACTION:

  gt_opt-dismode  = 'E'.

  gt_opt-updmode  = 'S'.

  gt_opt-racommit = 'X'.

  gt_opt-nobinpt = space.

  gt_opt-nobiend = 'X'.

  CALL TRANSACTION 'ZZ_MY_TC'    USING bdcdata

                               OPTIONS FROM gt_opt

                              MESSAGES INTO lt_mess.

But... we have another problem... we need an extra manual ENTER. I mean when the batch input ends the fields are still in editable mode, we need to hit ENTER to trigger the PAI and PBO again and then the fields become not editable...

So we need to simulate an ENTER, we are trying with the FM SAPGUI_SET_FUNCTIONCODE but we don't know when use it.

Do you know how can we achieve it ?

Thanks.

0 Kudos

The problem is that at the end of the batch-input data, the system executes one last PBO and display the screen, so you don't get control.

The not too complex solution I could see is to

  • Add one function "LOCKDATA" in your dynpro status.
  • Execute this function in the latest of bdcdata dynpro.
  • This function will set a variable in the global data.
  • No longer use sy-binptn but this variable to disable input in the PBO. 
  • At the beginning of the transaction initialize this variable
  • You may also require to disable the "LOCKDATA" function if either the variable is set (bdc has already executed it) or at start of transaction if sy-binpt is initial (user is executing the transaction directly) - or just try to hide the code.

Another solution could come from FM like BDC_RUNNING, you could try its execution during execution of itab steps and after, but not much hope ?

Regards,

Raymond

0 Kudos

Thanks Raymond for your support ! In the end the solution is easier than we thought !!!

ThomasZloch
Active Contributor
0 Kudos

I don't know by heart if there is a secret function module or kernel call that let's you distinguish this.

As alternative, since it's your custom transaction, you could maybe introduce another screen that contains the same fields as filled before, just in display mode. If you stop the screen sequence on this new screen, you might have what you want.


Thomas

0 Kudos

Hi Thomas,

Thansk for reply.

This is our last choice. These programs are done by other company and we don't know well all the code. And for this we need to change a lot of things. these fields are in a subscreen inside of a table control...

If there is no choice we'll do it, but we prefer to look for other way to do it.

Thanks.