2007 Jun 08 6:39 AM
hi SDNers,
I have one bdc.I want to fill one field with null values. that field already having values. how can i do?
reward sure if it is helpful...
regards,
Senthil kumar
2007 Jun 08 6:44 AM
hi,
u said that field is already having values so in that bdc when u r passing values to that particular screen manually pass '0' to that field so that u can override its previous value.
hi,
u said that field is already having values so in that bdc when u r passing values to that particular screen manually pass '0' to that field so that u can override its previous value.
2007 Jun 08 6:41 AM
hi,
when u do recording just delete that value and put it blank..........
in recording it will so u blank.......................
reward points if helpful,
Regards,
Imran
2007 Jun 08 6:43 AM
Hi,
Before passing the value to the BDCDATA structure, you will pass that field, so before passing that value check that field, if the value is not initial, then pass Null to it.
IF NOT FIELD is initial.
FIELD = SPACE.
ENDIF.
Regards
Sudheer
2007 Jun 08 6:44 AM
hi,
u said that field is already having values so in that bdc when u r passing values to that particular screen manually pass '0' to that field so that u can override its previous value.
2007 Jun 08 6:46 AM
hi
good
during runtime try to change the field value of the internal table for that particular screen ,or change that particular field value in your flat file.
thanks
mrutyun^
2007 Jun 08 6:47 AM
Hi Senthil,
In your BDC, Replace null/space in place of the value against the field name. just simple
Regards,
Younus
<b>Reward Helpful Answers:-)</b>
2007 Jun 08 7:22 AM
HI SDNers,
I did all the possible ways.
its not sounds good...
any other suggestions...
Senthil kumar
2007 Jun 08 8:32 AM
hi.senthil.
i tried for ur query its working.
refer this code.
in this i made customer as initaial(lfa1-kunnr).
report ZVENDOR_RECORD5
no standard page heading line-size 255.
include bdcrecx1.
tables:rf02k,LFA1,lfb1,lfm1.
DATA: BEGIN OF itab OCCURS 0,
LIFNR TYPE RF02K-LIFNR,
BUKRS TYPE RF02K-BUKRS,
EKORG TYPE RF02K-EKORG,
KTOKK TYPE RF02K-KTOKK,
ANRED TYPE LFA1-ANRED,
NAME1 TYPE LFA1-NAME1,
SORTL TYPE LFA1-SORTL,
LAND1 TYPE LFA1-LAND1,
KUNNR TYPE LFA1-KUNNR,
AKONT TYPE LFB1-AKONT,
FDGRV TYPE LFB1-FDGRV,
WAERS TYPE LFM1-WAERS,
END OF itab.
start-of-selection.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
CODEPAGE = ' '
FILENAME = 'C:\Documents and Settings\sonagaraj\Desktop\1.TXT'
FILETYPE = 'DAT'
HEADLEN = ' '
LINE_EXIT = ' '
TRUNCLEN = ' '
USER_FORM = ' '
USER_PROG = ' '
DAT_D_FORMAT = ' '
IMPORTING
FILELENGTH =
TABLES
DATA_TAB = ITAB
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
NO_AUTHORITY = 10
OTHERS = 11
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
perform open_group.
LOOP AT ITAB.
perform bdc_dynpro using 'SAPMF02K' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-KTOKK'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02K-LIFNR'
ITAB-LIFNR.
perform bdc_field using 'RF02K-BUKRS'
ITAB-BUKRS.
perform bdc_field using 'RF02K-EKORG'
ITAB-EKORG.
perform bdc_field using 'RF02K-KTOKK'
ITAB-KTOKK.
perform bdc_dynpro using 'SAPMF02K' '0110'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-LAND1'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LFA1-ANRED'
ITAB-ANRED.
perform bdc_field using 'LFA1-NAME1'
ITAB-NAME1.
perform bdc_field using 'LFA1-SORTL'
ITAB-SORTL.
perform bdc_field using 'LFA1-LAND1'
ITAB-LAND1.
perform bdc_dynpro using 'SAPMF02K' '0120'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-KUNNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
IF NOT itab-kunnr is initial.
itab-kunnr = SPACE.
ENDIF.
perform bdc_field using 'LFA1-KUNNR'
ITAB-KUNNR.
perform bdc_dynpro using 'SAPMF02K' '0130'.
perform bdc_field using 'BDC_CURSOR'
'LFBK-BANKS(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_dynpro using 'SAPMF02K' '0210'.
perform bdc_field using 'BDC_CURSOR'
'LFB1-FDGRV'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LFB1-AKONT'
ITAB-AKONT.
perform bdc_field using 'LFB1-FDGRV'
ITAB-FDGRV.
perform bdc_dynpro using 'SAPMF02K' '0215'.
perform bdc_field using 'BDC_CURSOR'
'LFB1-ZTERM'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPMF02K' '0220'.
perform bdc_field using 'BDC_CURSOR'
'LFB5-MAHNA'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPMF02K' '0310'.
perform bdc_field using 'BDC_CURSOR'
'LFM1-WAERS'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LFM1-WAERS'
ITAB-WAERS.
perform bdc_dynpro using 'SAPMF02K' '0320'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-LIFNR'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
perform bdc_transaction using 'XK01'.
ENDLOOP.
perform close_group.
2007 Jun 08 10:15 AM
Hi sowmya,
it not sounds good.
my coding is here.
jus check..
report ZPM_TRM_IE02
no standard page heading line-size 255.
data: begin of itab occurs 0,
EQUNR LIKE RM63E-EQUNR, " Equipment No
ARBPL LIKE ITOBATTR-ARBPL, " WORK CENTER
INGRP LIKE ITOB-INGRP,
GEWRK LIKE ITOBATTR-GEWRK,
WERGW LIKE ITOBATTR-WERGW,
RBNR LIKE ITOB-RBNR,
TPLNR LIKE IEQINSTALL-TPLNR, "Fun. Location
MA7 LIKE RM63A_VGL-MA7,
MA8 LIKE RM63A_VGL-MA8,
end of itab.
*DATA : BEGIN OF ITAB OCCURS 0,
EQUNR(18) TYPE C,
ARBPL(8) TYPE C,
INGRP(3) TYPE C,
GEWRK(8) TYPE C,
WERGW(4) TYPE C,
RBNR(9) TYPE C,
TPLNR(40) TYPE C,
MA7(1) TYPE C,
MA8(1) TYPE C,
END OF ITAB.
include bdcrecx1.
start-of-selection.
CALL FUNCTION 'UPLOAD'
EXPORTING
CODEPAGE = ' '
FILENAME = ' '
FILETYPE = 'DAT'
TABLES
DATA_TAB = itab.
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
perform open_group.
loop at itab.
perform bdc_dynpro using 'SAPMIEQ0' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RM63E-EQUNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RM63E-EQUNR'
itab-equnr." 'TOOL1'.
perform bdc_dynpro using 'SAPMIEQ0' '0101'.
perform bdc_field using 'BDC_OKCODE'
'=T\02'.
perform bdc_field using 'BDC_CURSOR'
'ITOB-SHTXT'.
*perform bdc_field using 'ITOB-SHTXT'
'press tool for test - pt1'.
perform bdc_dynpro using 'SAPMIEQ0' '0101'.
perform bdc_field using 'BDC_OKCODE'
'=T\03'.
perform bdc_field using 'BDC_CURSOR'
'ITOBATTR-ARBPL'.
*perform bdc_field using 'ITOB-BEBER'
'STR'.
IF NOT ITAB-ARBPL IS INITIAL.
perform bdc_field using 'ITOBATTR-ARBPL'
itab-arbpl." ''.
ELSE.
ITAB-ARBPL = SPACE.
perform bdc_field using 'ITOBATTR-ARBPL'
itab-arbpl." ''.
ENDIF.
*perform bdc_field using 'ITOB-SHTXT'
'press tool for test - pt1'.
perform bdc_dynpro using 'SAPMIEQ0' '0101'.
perform bdc_field using 'BDC_OKCODE'
'T\04'.
perform bdc_field using 'ITOB-BUKRS'
'1000'.
*perform bdc_field using 'ITOB-GSBER'
'1001'.
*perform bdc_field using 'ITOB-KOSTL'
'999999'.
perform bdc_field using 'BDC_CURSOR'
'ITOB-RBNR'.
*perform bdc_field using 'ITOB-IWERK'
'1000'.
perform bdc_field using 'ITOB-INGRP'
itab-ingrp." 'TR1'.
perform bdc_field using 'ITOBATTR-GEWRK'
itab-gewrk." 'TRM-BDN1'.
perform bdc_field using 'ITOB-RBNR'
itab-rbnr." 'TOOL'.
perform bdc_field using 'ITOBATTR-WERGW'
itab-wergw." '1000'.
*perform bdc_field using 'ITOB-SHTXT'
'press tool for test - pt1'.
perform bdc_dynpro using 'SAPMIEQ0' '0101'.
perform bdc_field using 'BDC_OKCODE'
'=CIPL'.
perform bdc_field using 'BDC_CURSOR'
'ITOB-SHTXT'.
*perform bdc_field using 'ITOB-SHTXT'
'press tool for test - pt1'.
perform bdc_dynpro using 'SAPLIEL2' '0100'.
perform bdc_field using 'BDC_CURSOR'
'IEQINSTALL-DATUM'.
perform bdc_field using 'BDC_OKCODE'
'=IPDL'.
*perform bdc_field using 'IEQINSTALL-DATUM'
'19.05.2007'.
*perform bdc_field using 'IEQINSTALL-UZEIT'
'14:29:05'.
perform bdc_dynpro using 'SAPLIEL2' '0100'.
perform bdc_field using 'BDC_CURSOR'
'IEQINSTALL-TPLNR'.
perform bdc_field using 'BDC_OKCODE'
'=INDT'.
perform bdc_field using 'IEQINSTALL-TPLNR'
itab-tplnr." 'PIC-P01-STR'.
*perform bdc_field using 'IEQINSTALL-DATUM'
'19.05.2007'.
*perform bdc_field using 'IEQINSTALL-UZEIT'
'14:29:05'.
perform bdc_dynpro using 'SAPLIEL2' '0103'.
perform bdc_field using 'BDC_OKCODE'
'/ERW'.
perform bdc_field using 'BDC_CURSOR'
'RM63A_VGL-MA7'.
*perform bdc_field using 'RM63A_VGL-MA1'
'X'.
*perform bdc_field using 'RM63A_VGL-MA2'
'X'.
*perform bdc_field using 'RM63A_VGL-MA3'
'X'.
*perform bdc_field using 'RM63A_VGL-MA4'
'X'.
*perform bdc_field using 'RM63A_VGL-MA5'
'X'.
*perform bdc_field using 'RM63A_VGL-MA6'
'X'.
perform bdc_field using 'RM63A_VGL-MA7'
itab-ma7." 'X'.
*perform bdc_field using 'RM63A_VGL-EQ7'
''.
perform bdc_field using 'RM63A_VGL-MA8'
itab-ma8." 'X'.
*perform bdc_field using 'RM63A_VGL-EQ8'
''.
*perform bdc_field using 'RM63A_VGL-MA9'
'X'.
*perform bdc_field using 'RM63A_VGL-MA10'
'X'.
*perform bdc_field using 'RM63A_VGL-MA11'
'X'.
*perform bdc_field using 'RM63A_VGL-EQ12'
'X'.
*perform bdc_field using 'RM63A_VGL-EQ14'
'X'.
*perform bdc_field using 'RM63A_VGL-EQ15'
'X'.
*perform bdc_field using 'RM63A_VGL-MA16'
'X'.
perform bdc_dynpro using 'SAPLIEL2' '0100'.
perform bdc_field using 'BDC_CURSOR'
'IEQINSTALL-DATUM'.
perform bdc_field using 'BDC_OKCODE'
'=EXIT'.
*perform bdc_field using 'IEQINSTALL-DATUM'
'19.05.2007'.
*perform bdc_field using 'IEQINSTALL-UZEIT'
'14:29:05'.
perform bdc_dynpro using 'SAPMIEQ0' '0101'.
perform bdc_field using 'BDC_OKCODE'
'=BU'.
perform bdc_field using 'BDC_CURSOR'
'ITOB-SHTXT'.
*perform bdc_field using 'ITOB-SHTXT'
'press tool for test - pt1'.
perform bdc_transaction using 'IE02'.
endloop.
perform close_group.
Regards,
Senthil kumar
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |