2006 Feb 03 10:12 AM
Hello guys,
I am currently modifying a BDC program where in I want to change a value from one screen to another. Please see my code below. for example, I typed in the value 100 in screen 110 but I want to change it to 0 in screen 285. Is there a way to this? So when I run my BDC program and it calls transaction ABAA and I put in the value 100 on the first screen which is 110 and when I press enter the value 100 would be instead 0. As you can see I have tried to clear the variables that I think affects the values. Help would really be appreciated.
PEFORM GENERATE_BDC_ABAA.
FORM GENERATE_BDC_ABAA.
DATA: I_ANBTR LIKE ANEP-ANBTR.
DATA: C_ANBTR(16), C_ANBTR2(16), C_DMBTR(16).
DATA: V_MODE(1).
CLEAR IT_REC.
LOOP AT IT_REC.
DI_LOOP = DI_LOOP + 1.
REFRESH BDCDATA.
PERFORM GENERATE_BDC_DATA_ABAA.
V_MODE = 'E'.
*AVH
i_anbtr = anep-anbtr.
clear i_anbtr.
clear it_rec-dmbtr.
clear anep-anbtr.
move: space to anep-anbtr.
move space to it_rec-dmbtr.
CALL TRANSACTION 'ABAA' USING BDCDATA MODE V_MODE
MESSAGES INTO IT_BDCMSGCOLL.
IF SY-SUBRC EQ 0.
ADD 1 TO SUC_CTR.
PERFORM INSERT_SUCCESS_MSG.
ELSE.
READ TABLE IT_BDCMSGCOLL INDEX DI_LOOP.
MOVE IT_BDCMSGCOLL TO WA_BDCMSGCOLL.
ADD 1 TO ERR_CTR.
PERFORM INSERT_ERROR_MSG.
ENDIF.
ENDLOOP.
ENDFORM. " GENERATE_BDC_ABAA
PEFORM GENERATE_BDC_DATA_ABAA.
FORM GENERATE_BDC_DATA_ABAA.
DATA: I_ANBTR LIKE ANEP-ANBTR.
DATA: C_ANBTR(16), C_ANBTR2(16), C_DMBTR(16).
*AVH
data: no_val like anep-anbtr.
data: no_val2 like it_rec-dmbtr.
move space to no_val2.
move space to no_val.
*AVH
i_anbtr = anep-anbtr.
clear i_anbtr.
clear it_rec-dmbtr.
clear anep-anbtr.
move: space to anep-anbtr.
move space to it_rec-dmbtr.
move space to no_val.
PERFORM BDC_DYNPRO USING 'SAPMA01B' '0100'.
PERFORM BDC_FIELD USING:
'BDC_OKCODE' '/00',
'ANBZ-BUKRS' 'GLOB',
'ANBZ-ANLN1' IT_REC-ANLN1,
'ANBZ-ANLN2' IT_REC-ANLN2,
'ANEK-BLDAT' IT_REC-BLDAT,
'ANEK-BUDAT' IT_REC-BUDAT,
'ANBZ-PERID' IT_REC-PERID,
'ANBZ-BWASL' IT_REC-BWASL.
*AVH
i_anbtr = anep-anbtr.
clear i_anbtr.
clear it_rec-dmbtr.
clear anbz-dmbtr.
clear anep-anbtr.
move: space to anep-anbtr.
move space to it_rec-dmbtr.
move space to no_val.
PERFORM BDC_DYNPRO USING 'SAPMA01B' '0110'.
PERFORM BDC_FIELD USING:
'BDC_OKCODE' '/00',
'ANBZ-DMBTR' IT_REC-DMBTR,
'ANBZ-BZDAT' IT_REC-BUDAT,
'ANEK-SGTXT' IT_REC-SGTXT.
*AVH
"I_ANBTR = '0'. "IT_REC-DMBTR * -1.
*AVH
i_anbtr = anep-anbtr.
clear i_anbtr.
clear it_rec-dmbtr.
clear anep-anbtr.
move: space to anep-anbtr.
move space to it_rec-dmbtr.
move space to no_val.
perform bdc_dynpro using 'SAPMA01B' '0285'. " '0600'.
*AVH
move space to no_val.
perform bdc_field using 'BDC_CURSOR'
'NO_VAL'. "'ANEP-ANBTR'.
perform bdc_field using 'BDC_OKCODE'
'=AUSF'.
*AVH
i_anbtr = anep-anbtr.
clear i_anbtr.
clear it_rec-dmbtr.
clear anep-anbtr.
move: space to anep-anbtr.
move space to it_rec-dmbtr.
move space to no_val.
PERFORM BDC_DYNPRO USING 'SAPMA01B' '0285'. " '0600'.
*AVH
move space to no_val.
PERFORM BDC_FIELD USING:
'BDC_CURSOR' 'NO_VAL', "'ANEP-ANBTR',
'BDC_OKCODE' '=AUSF'.
*AVH
i_anbtr = anep-anbtr.
clear i_anbtr.
clear it_rec-dmbtr.
clear anep-anbtr.
move: space to anep-anbtr.
move space to it_rec-dmbtr.
move space to no_val.
PERFORM BDC_DYNPRO USING 'SAPMA01B' '0110'.
PERFORM BDC_FIELD USING:
'BDC_OKCODE' '=UPDA',
'ANBZ-DMBTR' IT_REC-DMBTR,
'ANBZ-BZDAT' IT_REC-BUDAT,
'ANEK-SGTXT' IT_REC-SGTXT.
*AVH
i_anbtr = anep-anbtr.
clear i_anbtr.
clear it_rec-dmbtr.
clear anep-anbtr.
move: space to anep-anbtr.
move space to it_rec-dmbtr.
move space to no_val.
PERFORM BDC_DYNPRO USING 'SAPMA01B' '0285'. " '0600'.
PERFORM BDC_FIELD USING:
'BDC_CURSOR' 'NO_VAL', "'ANEP-ANBTR',
'BDC_OKCODE' '=AUSF'.
*AVH
i_anbtr = anep-anbtr.
clear i_anbtr.
clear it_rec-dmbtr.
clear anep-anbtr.
move: space to anep-anbtr.
move space to it_rec-dmbtr.
move space to no_val.
PERFORM BDC_DYNPRO USING 'SAPMA01B' '0285'. " '0600'.
PERFORM BDC_FIELD USING:
'BDC_CURSOR' 'NO_VAL', "'ANEP-ANBTR',
'BDC_OKCODE' '=AUSF'.
PERFORM BDC_DYNPRO USING 'SAPMA01B' '0110'.
PERFORM BDC_FIELD USING:
'BDC_OKCODE' '=UPDA'.
ENDFORM. " GENERATE_BDC_DATA_ABAA
2006 Feb 03 11:25 AM
Hi Viraylab,
Each time before you go into each screen and input these values you need to modify the same.
For eg: in this following code
PERFORM BDC_FIELD USING:
'BDC_OKCODE' '/00',
'ANBZ-DMBTR' IT_REC-DMBTR,
'ANBZ-BZDAT' IT_REC-BUDAT,
'ANEK-SGTXT' IT_REC-SGTXT.
say you need to have a value 110 for IT_REC-DMBTR then you need to assign this value before this above mentioned statement as follows:
clear: IT_REC-DMBTR.
move '0' to IT_REC-DMBTR.
PERFORM BDC_FIELD USING:
'BDC_OKCODE' '/00',
'ANBZ-DMBTR' IT_REC-DMBTR,
'ANBZ-BZDAT' IT_REC-BUDAT,
'ANEK-SGTXT' IT_REC-SGTXT.
Cheers
JK
PS: Award points if this helps you.
Hello guys,
I am currently modifying a BDC program where in I want to change a value from one screen to another. Please see my code below. for example, I typed in the value 100 in screen 110 but I want to change it to 0 in screen 285. Is there a way to this? So when I run my BDC program and it calls transaction ABAA and I put in the value 100 on the first screen which is 110 and when I press enter the value 100 would be instead 0. As you can see I have tried to clear the variables that I think affects the values. Help would really be appreciated.
PEFORM GENERATE_BDC_ABAA.
FORM GENERATE_BDC_ABAA.
DATA: I_ANBTR LIKE ANEP-ANBTR.
DATA: C_ANBTR(16), C_ANBTR2(16), C_DMBTR(16).
DATA: V_MODE(1).
CLEAR IT_REC.
LOOP AT IT_REC.
DI_LOOP = DI_LOOP + 1.
REFRESH BDCDATA.
PERFORM GENERATE_BDC_DATA_ABAA.
V_MODE = 'E'.
*AVH
i_anbtr = anep-anbtr.
clear i_anbtr.
clear it_rec-dmbtr.
clear anep-anbtr.
move: space to anep-anbtr.
move space to it_rec-dmbtr.
CALL TRANSACTION 'ABAA' USING BDCDATA MODE V_MODE
MESSAGES INTO IT_BDCMSGCOLL.
IF SY-SUBRC EQ 0.
ADD 1 TO SUC_CTR.
PERFORM INSERT_SUCCESS_MSG.
ELSE.
READ TABLE IT_BDCMSGCOLL INDEX DI_LOOP.
MOVE IT_BDCMSGCOLL TO WA_BDCMSGCOLL.
ADD 1 TO ERR_CTR.
PERFORM INSERT_ERROR_MSG.
ENDIF.
ENDLOOP.
ENDFORM. " GENERATE_BDC_ABAA
PEFORM GENERATE_BDC_DATA_ABAA.
FORM GENERATE_BDC_DATA_ABAA.
DATA: I_ANBTR LIKE ANEP-ANBTR.
DATA: C_ANBTR(16), C_ANBTR2(16), C_DMBTR(16).
*AVH
data: no_val like anep-anbtr.
data: no_val2 like it_rec-dmbtr.
move space to no_val2.
move space to no_val.
*AVH
i_anbtr = anep-anbtr.
clear i_anbtr.
clear it_rec-dmbtr.
clear anep-anbtr.
move: space to anep-anbtr.
move space to it_rec-dmbtr.
move space to no_val.
PERFORM BDC_DYNPRO USING 'SAPMA01B' '0100'.
PERFORM BDC_FIELD USING:
'BDC_OKCODE' '/00',
'ANBZ-BUKRS' 'GLOB',
'ANBZ-ANLN1' IT_REC-ANLN1,
'ANBZ-ANLN2' IT_REC-ANLN2,
'ANEK-BLDAT' IT_REC-BLDAT,
'ANEK-BUDAT' IT_REC-BUDAT,
'ANBZ-PERID' IT_REC-PERID,
'ANBZ-BWASL' IT_REC-BWASL.
*AVH
i_anbtr = anep-anbtr.
clear i_anbtr.
clear it_rec-dmbtr.
clear anbz-dmbtr.
clear anep-anbtr.
move: space to anep-anbtr.
move space to it_rec-dmbtr.
move space to no_val.
PERFORM BDC_DYNPRO USING 'SAPMA01B' '0110'.
PERFORM BDC_FIELD USING:
'BDC_OKCODE' '/00',
'ANBZ-DMBTR' IT_REC-DMBTR,
'ANBZ-BZDAT' IT_REC-BUDAT,
'ANEK-SGTXT' IT_REC-SGTXT.
*AVH
"I_ANBTR = '0'. "IT_REC-DMBTR * -1.
*AVH
i_anbtr = anep-anbtr.
clear i_anbtr.
clear it_rec-dmbtr.
clear anep-anbtr.
move: space to anep-anbtr.
move space to it_rec-dmbtr.
move space to no_val.
perform bdc_dynpro using 'SAPMA01B' '0285'. " '0600'.
*AVH
move space to no_val.
perform bdc_field using 'BDC_CURSOR'
'NO_VAL'. "'ANEP-ANBTR'.
perform bdc_field using 'BDC_OKCODE'
'=AUSF'.
*AVH
i_anbtr = anep-anbtr.
clear i_anbtr.
clear it_rec-dmbtr.
clear anep-anbtr.
move: space to anep-anbtr.
move space to it_rec-dmbtr.
move space to no_val.
PERFORM BDC_DYNPRO USING 'SAPMA01B' '0285'. " '0600'.
*AVH
move space to no_val.
PERFORM BDC_FIELD USING:
'BDC_CURSOR' 'NO_VAL', "'ANEP-ANBTR',
'BDC_OKCODE' '=AUSF'.
*AVH
i_anbtr = anep-anbtr.
clear i_anbtr.
clear it_rec-dmbtr.
clear anep-anbtr.
move: space to anep-anbtr.
move space to it_rec-dmbtr.
move space to no_val.
PERFORM BDC_DYNPRO USING 'SAPMA01B' '0110'.
PERFORM BDC_FIELD USING:
'BDC_OKCODE' '=UPDA',
'ANBZ-DMBTR' IT_REC-DMBTR,
'ANBZ-BZDAT' IT_REC-BUDAT,
'ANEK-SGTXT' IT_REC-SGTXT.
*AVH
i_anbtr = anep-anbtr.
clear i_anbtr.
clear it_rec-dmbtr.
clear anep-anbtr.
move: space to anep-anbtr.
move space to it_rec-dmbtr.
move space to no_val.
PERFORM BDC_DYNPRO USING 'SAPMA01B' '0285'. " '0600'.
PERFORM BDC_FIELD USING:
'BDC_CURSOR' 'NO_VAL', "'ANEP-ANBTR',
'BDC_OKCODE' '=AUSF'.
*AVH
i_anbtr = anep-anbtr.
clear i_anbtr.
clear it_rec-dmbtr.
clear anep-anbtr.
move: space to anep-anbtr.
move space to it_rec-dmbtr.
move space to no_val.
PERFORM BDC_DYNPRO USING 'SAPMA01B' '0285'. " '0600'.
PERFORM BDC_FIELD USING:
'BDC_CURSOR' 'NO_VAL', "'ANEP-ANBTR',
'BDC_OKCODE' '=AUSF'.
PERFORM BDC_DYNPRO USING 'SAPMA01B' '0110'.
PERFORM BDC_FIELD USING:
'BDC_OKCODE' '=UPDA'.
ENDFORM. " GENERATE_BDC_DATA_ABAA
2006 Feb 03 11:25 AM
Hi Viraylab,
Each time before you go into each screen and input these values you need to modify the same.
For eg: in this following code
PERFORM BDC_FIELD USING:
'BDC_OKCODE' '/00',
'ANBZ-DMBTR' IT_REC-DMBTR,
'ANBZ-BZDAT' IT_REC-BUDAT,
'ANEK-SGTXT' IT_REC-SGTXT.
say you need to have a value 110 for IT_REC-DMBTR then you need to assign this value before this above mentioned statement as follows:
clear: IT_REC-DMBTR.
move '0' to IT_REC-DMBTR.
PERFORM BDC_FIELD USING:
'BDC_OKCODE' '/00',
'ANBZ-DMBTR' IT_REC-DMBTR,
'ANBZ-BZDAT' IT_REC-BUDAT,
'ANEK-SGTXT' IT_REC-SGTXT.
Cheers
JK
PS: Award points if this helps you.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |