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: 

Call transaction VLMOVE with HUWBEVENT and HU

former_member184158
Active Contributor
0 Kudos

Hello experts,

I have tried to call a transaction VLOMVE with HUWBEVENT and HU (EXIDV)  but I have gotten a message that is not an input field,

but it is when I enter BWART ( movement type) ? how can I do it while calling a transaction..

REPORT  zibo_test1.

DATAlt_sel       TYPE TABLE OF bdcdata,
      ls_sel      
type bdcdata.
CLEAR ls_sel .
ls_sel
-program = 'SAPLLE_MOV'.
ls_sel
-dynpro  = '2000'.
ls_sel
-dynbegin = 'X' .
APPEND ls_sel TO lt_sel.

CLEAR ls_sel .
ls_sel
-fnam = 'LEMOVHUS-HUWBEVENT'.
ls_sel
-fval = '311'.
APPEND ls_sel TO lt_sel.

CLEAR ls_sel .
ls_sel
-fnam = 'LEMOVHUS-EXIDV'.
ls_sel
-fval = '116'.
APPEND ls_sel TO lt_sel.

CALL FUNCTION 'ABAP4_CALL_TRANSACTION'
 
EXPORTING
    tcode    
= 'VLMOVE'
 
TABLES
    using_tab
= lt_sel.

This transaction, at the beginning you can enter the BWART and then enter HU which HU(EXIDV) will be active.

Any suggestions please?

Regards

Ibrahim

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Ibrahim,

Eid Mubarak!!!

Two things:

1. Did you notice you have to press enter after selecting 311 from dropdown. ? Then only the HU field becomes open for input. In your code you are not doing that.

2. Also any dropdown will have a key and value. The "311" is the value but the key is "0006" that you should pass.

So your modified code should be: Lines marked in bold are the changes to your code.

DATAlt_sel       TYPE TABLE OF bdcdata,

       ls_sel       type bdcdata.

CLEAR ls_sel .

ls_sel-program = 'SAPLLE_MOV'.

ls_sel-dynpro  = '2000'.

ls_sel-dynbegin = 'X' .

APPEND ls_sel TO lt_sel.

CLEAR ls_sel .

ls_sel-fnam = 'LEMOVHUS-HUWBEVENT'.

ls_sel-fval = '0006'.

APPEND ls_sel TO lt_sel.

CLEAR ls_sel .

ls_sel-fnam = 'BDC_OKCODE'.

ls_sel-fval = '=TCVG'.

APPEND ls_sel TO lt_sel.

ls_sel-program = 'SAPLLE_MOV'.

ls_sel-dynpro  = '2000'.

ls_sel-dynbegin = 'X' .

APPEND ls_sel TO lt_sel.

CLEAR ls_sel .

ls_sel-fnam = 'LEMOVHUS-EXIDV'.

ls_sel-fval = '25116'.

APPEND ls_sel TO lt_sel.

CALL FUNCTION 'ABAP4_CALL_TRANSACTION'

   EXPORTING

     tcode     = 'VLMOVE'

   TABLES

     using_tab = lt_sel.


R

5 REPLIES 5

former_member355261
Participant
0 Kudos

Hi,

I think it may be an authorization issue.

Regards

Former Member
0 Kudos

Hi Ibrahim,

Eid Mubarak!!!

Two things:

1. Did you notice you have to press enter after selecting 311 from dropdown. ? Then only the HU field becomes open for input. In your code you are not doing that.

2. Also any dropdown will have a key and value. The "311" is the value but the key is "0006" that you should pass.

So your modified code should be: Lines marked in bold are the changes to your code.

DATAlt_sel       TYPE TABLE OF bdcdata,

       ls_sel       type bdcdata.

CLEAR ls_sel .

ls_sel-program = 'SAPLLE_MOV'.

ls_sel-dynpro  = '2000'.

ls_sel-dynbegin = 'X' .

APPEND ls_sel TO lt_sel.

CLEAR ls_sel .

ls_sel-fnam = 'LEMOVHUS-HUWBEVENT'.

ls_sel-fval = '0006'.

APPEND ls_sel TO lt_sel.

CLEAR ls_sel .

ls_sel-fnam = 'BDC_OKCODE'.

ls_sel-fval = '=TCVG'.

APPEND ls_sel TO lt_sel.

ls_sel-program = 'SAPLLE_MOV'.

ls_sel-dynpro  = '2000'.

ls_sel-dynbegin = 'X' .

APPEND ls_sel TO lt_sel.

CLEAR ls_sel .

ls_sel-fnam = 'LEMOVHUS-EXIDV'.

ls_sel-fval = '25116'.

APPEND ls_sel TO lt_sel.

CALL FUNCTION 'ABAP4_CALL_TRANSACTION'

   EXPORTING

     tcode     = 'VLMOVE'

   TABLES

     using_tab = lt_sel.


R

0 Kudos

HI Rudra,

Eid Mubarek too.

yes you are right, of course I have tried it out, and I have written, that the HU input field will be active only if you enter the BWART 311 as an example., I have tried also with SHDB, but I get this issue  ok_code = TCVG

so the question, could we do this command OK_CODE as background ;

Regards

Ibrahim

0 Kudos

Hi again,

I am afraid No.

May be you could call the entire transaction in background by passing MOD_VAL = 'N' ( Or 'E' if you have any error it will stop) in ABAP4_CALL_TRANSACTION.

Part of transaction is background and Part of transaction in foreground is not possible.

I checked the standard transaction code also and we cannot have implicit enhancement also to override what SAP is doing.

R

0 Kudos

Hi

Thank you, I have tried it out, and now it works by using mode_val = 'E'

CALL FUNCTION 'ABAP4_CALL_TRANSACTION'

    EXPORTING

      tcode     = 'VLMOVE'

     MODE_VAL                      = 'E'

    TABLES

      using_tab = lt_sel.


Regards

Ibrahim