‎2007 Mar 16 5:58 AM
hi,
friends,
can u explain why program,dynopro,dynbegin,fnam & fval r used in bdc's.
what is mapping in bdc.how we map, i means which 2things r mapped.
‎2007 Mar 16 6:04 AM
HI,
In BDCDATA..
PROGRAM is name of the standard program for the application(ex for VA01 SAPMV45A)
DYNPRO: Screen number(starting screen number)
DYNBEGIN: indicator for new screen(if u pass X to this )
FNAM:name of the field
FVAL:value of the field.
here filed names n values are ....in ur flat file it contains some fields...u want to update those field values in database table...
Mapping in the sense u have to assign these fields to the standard database fields through this application.
Kishore.
‎2007 Mar 16 6:04 AM
HI,
In BDCDATA..
PROGRAM is name of the standard program for the application(ex for VA01 SAPMV45A)
DYNPRO: Screen number(starting screen number)
DYNBEGIN: indicator for new screen(if u pass X to this )
FNAM:name of the field
FVAL:value of the field.
here filed names n values are ....in ur flat file it contains some fields...u want to update those field values in database table...
Mapping in the sense u have to assign these fields to the standard database fields through this application.
Kishore.
‎2007 Mar 16 6:05 AM
program- program name
dynopro--- Screen number
dynbegin---- Flag to say start of screen
fnam --- name of field on screen
fval---- value in field
the above variable are used to map the fields in the file to be uploaded to the fields on the screen so that the correct values are updated in database
‎2007 Mar 16 6:12 AM
mapping means comparing the fields in the flat file & the screen means which screen.
‎2007 Mar 16 6:12 AM
BDC Methods need a common data structure for storing the instructions and data for SAP transactions. This structure is defined as BDCDATA in the dictionary.
Fields of BDCDATA Structure
PROGRAM [CHAR 8] - Online Program Name
DYNPRO [NUMC 4] - Screen Number
DYNBEGIN [CHAR 1]-Flag to Indicate the start of a new screen
FNAM [CHAR 35]- Field name of a screen field to be filled with Data
FVAL [CHAR 80]-The actual value to be filled into the specified screen field
‎2007 Mar 16 6:15 AM
Hi Lakshmi,
Coming to your first question,
Actually the things which you have asked are the parameters in the BDC_OPEN_GROUP which is a FM for the SESSION Method.
They are
program : Program Name
dynpro : screen no.
dynbegin.: First screen
fnam : User-defined variable for passing screen field name.
fval : : User-defined variable for passing screen field value
In Session method, First the data is uploaded from flat file ,then it is mapped and then it is populated into our BDCTAB. So here, mapping is the method which links the user-defined field to the Pre-defined SAP standard fields. So depending on the Data to be uploaded, we design the mapping logic. After mapping is successful, then data is uploaded into SAP.
Hope this resolves your query.
Reward all the helpful answers.
Regards
‎2007 Mar 16 6:20 AM
‎2007 Mar 16 6:23 AM
Hi Lakshmi,
Here BDCTAB is our internal table which we use for mapping purpose.After mapping the data is uploaded into this internal table and then subsequently through this into the SAP DB.
Hope this resolves your query.
Reward all the helpful answers.
Regards
‎2007 Mar 16 6:41 AM
is it right that first we have to upload the flat file to internal table then the internal table is mapped through program,dynpro,dynbegin,fnam & fval then it is uploaded in the database.
tables : kna1.
data : begin of itab occur 0,
kunnr like kna1-kunnr,
land1 like kna1-land1,
name1 like kna1-name1,
end of itab.
data : jatab like bdcdata occurs 0 with header line.
call f 'ws_upload'.
exporting
filename = 'c:\ses.txt'.
filetype ='dat'.
tables data_tab = itab.
call f 'BDC_OPEN_GROUP'
exporting
client = sy-mandt.
group ='ABC'.
holddate = sy_datum.
keep = 'X'.
user = sy-uname.
loop at itab.
refresh jtab.
perform sub1 using 'yvtrans' 1000.
perform sub2 using 'kna1-kunnr' itab-kunnr.
perform sub2 using 'kna1-land1' itab-land1.
perform sub2 using 'kna1-name1' itab-name1.
call function 'bdc_insert'.
exporting
TCode ='yvtrans'.
tables dynprotab = jtab.
endloop.
call f 'bdc_close_group'.
form sub1 using A B
clear jtab.
jtab-program = A.
jtab -dynpro = B.
jtab-dynbegin = 'x'.
append jtab.
endform.
form sub2 using C D.
clear jtab.
jtab-fnam = C.
jtab-fval = D.
append jtab.
endform.
desing flat file.
49811 IN FDD
49812 IN AAA
yvtrans is trans. code designed-customer,country,name
buttons-display exit
can u explain in detail what each step is doing in the program.
where mapping is taking place & between which fields mapping exactly taking place.
‎2007 Mar 16 7:15 AM
Hi Lakshmi,
Check this matter.
This is your Program.
1. tables : kna1.
2. data : begin of itab occur 0,
3. kunnr like kna1-kunnr,
4. land1 like kna1-land1,
5. name1 like kna1-name1,
6. end of itab.
7.
8. data : jatab like bdcdata occurs 0 with header line.
9.
10. call f 'ws_upload'.
11. exporting
12. filename = 'c:\ses.txt'.
13. filetype ='dat'.
14. tables data_tab = itab.
15.
16. call f 'BDC_OPEN_GROUP'
17. exporting
18. client = sy-mandt.
19. group ='ABC'.
20. holddate = sy_datum.
21. keep = 'X'.
22. user = sy-uname.
23.
24. loop at itab.
25. refresh jtab.
26. perform sub1 using 'yvtrans' 1000.
27. perform sub2 using 'kna1-kunnr' itab-kunnr.
28. perform sub2 using 'kna1-land1' itab-land1.
29. perform sub2 using 'kna1-name1' itab-name1.
30.
31. call function 'bdc_insert'.
32. exporting
33. TCode ='yvtrans'.
34. tables dynprotab = jtab.
35. endloop.
36.
37. call f 'bdc_close_group'.
38. form sub1 using A B
39. clear jtab.
40. jtab-program = A.
41. jtab -dynpro = B.
42. jtab-dynbegin = 'x'.
43. append jtab.
44. endform.
45.
46. form sub2 using C D.
47. clear jtab.
48. jtab-fnam = C.
49. jtab-fval = D.
50. append jtab.
51. endform.
<b>EXPLANATION</b> :
Here, ITAB and JTAB are the internal tables, one is for fields declaration and other is for field mapping.
Later we upload data from flat file using the WS_UPLOAD FM and then move it into our ITAB. We design ITAB structure same as that of the Flat file field structure.
Then we go for the FM BDC_OPEN_GROUP which is used to create a session for processing the data, depending on the parameters given by us, such as group name of the session, whether to retain in the session log, which date session was created and name if the user creating the session, etc.
Then from lines 21 to 29 we go for mapping the ITAB fields with the JTAB using the perform statements. After the mapping is successful then it is inserted into our JTAB internal table using the FM BDC_INSERT. For this mapping the transaction which we design, here YVTRANS should also have the same fields as declared I our flat file and ITAB.
Then at last we give the FM BDC_CLOSE_GROUP. This FM is used to close the session in order for it to be processed at a later stage using SM35.
Hope this resolves your query.
Reward all the helpful answers.
Regards
‎2007 Mar 16 8:04 AM