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 can we do mapping of fields internal table(excel) to Some strcture...

Former Member
0 Kudos

Hi,

I would like to update the database table from the exel sheet which contains 50 coloumns all are GL,AP,AR,..., these fields has to be mapped into the internal table and should be mapped to GL-GL,GL-AP,GL-AR,AP-AR,AP-AP,AR-AR,etc.. and the internal table contains 83 fields.

plz help me, its very urgent....

Thanks

Message was edited by:

bhanu

13 REPLIES 13

alex_m
Active Contributor
0 Kudos

Who told u to update the data base table directly. Consult with your Business and use the transaction code for your purpose. Do it in BDC or via LSMW.

Former Member
0 Kudos

Hi Alexander Mariadoss,

Actvally the reqirement is as follows:

I.User will provide the populate the FI data in the file and to pass to the program

II.Call function module TEXT_CONVERT_XLS_TO_SAP to convert the data from excel format to text format and populate it in a internal table.

III.Check on the number of company code, if the number of company code is more than one, reject the file.

IV.Check, if the number of line items per document is more than 200 than reject the file.

V.Check on the control field for the date and number format followed the file and according to that convert the date into the SAP format

VI.Convert the data in the internal table into the certain strcture format and performing the mapping of the data as GL-GL,GL-AP,GL-AR,AR-AR etc and following the rule for certain stcture format.

The rules are as follow :

a) Left justify character fields.

b) Right justify numeric fields (inbound doc number).

c) Right justify amount decimal point and 2 decimal places. Not to use commas or the $ sign.

d) Null values must be blank (hex 40)

i have done upto point 5.but at 6th point i strckup.

alex_m
Active Contributor
0 Kudos

On six point also u can do it, but u r going to insert the record to direct SAP tables.

On 6th point what help u need.

Former Member
0 Kudos

Hi,

iam struck up at 6th point,that is how to map thease fields in the excelsheet?like GL-GL,GL-AP,GL-AR,AR-AR,AP-AR etc..

Thanks

alex_m
Active Contributor
0 Kudos

See the field order in excel sheet, create your internal table with that order and use the function module.

Reward for useful answers.

Message was edited by:

Alexander Mariadoss

Former Member
0 Kudos

Hi,

I have done allready wht you suggested iam strck up at only at 6th point..

plz help me..

thanks

alex_m
Active Contributor
0 Kudos

Whats your issue, the excel value are ppopulated in internal table. See in debug mode whether all the excel value are transfered to internal table.

Former Member
0 Kudos

Hi,

iam getting all the fields whn iam doing the debug,but u can once go thourgh the reqirement point 6th.we are doing mapping fields suppose

wa_datatab-col02 = wa_xxxxx-INTERFA_ID .

wa_datatab-col05 = wa_xxxxxx-GL_SPEC_ID.

etc...

allready we done col05 with GL_SPEC_ID,

NOW the issue.

are u again can map same field with other coloumn?

then how dont forget we are mapping this fields and send to inbound

thanks

alex_m
Active Contributor
0 Kudos

Loop at the internal table, check every record for your condition and apply the condition and prepare the exact internal table .

Like, check if the value is charecter then change to left justification and so on.

Still my worry is how u r going to update the SAP table.

Former Member
0 Kudos

Hi,

for below code how can we do mapping as AR-ARA,GL-GL,GL-AP,GL-AR,etc..

*****wa_datatab-col02 = wa_xxxxxx-INTERFA_ID .

*****wa_datatab-col03 = wa_xxxxxx-doc_date.

*****wa_datatab-col04 = wa_xxxxxx-ACCTG_DATE.

*****wa_datatab-col05 = wa_xxxxxx-doc_type.

*****wa_datatab-col06 = wa_xxxxxx-COMP_CODE.

*****wa_datatab-col07 = wa_xxxxxx-CURRENCY.

*****wa_datatab-col08 = wa_xxxxxx-TRANSLT_DT.

*****wa_datatab-col09 = wa_xxxxxx-REF_DOC_NO.

*****wa_datatab-col10 = wa_xxxxxx-DOC_TEXT.

*****wa_datatab-col11 = wa_xxxxxx-CALC_TAX.

******wa_datatab-col02 = wa_xxxxxx-

*****wa_datatab-col03 = wa_xxxxxx-AP_POSTKEY.

******wa_datatab-col04 = wa_xxxxxx-

*****

*****wa_datatab-col05 = wa_xxxxxx-GL_SPEC_ID.

*****wa_datatab-col06 = wa_xxxxxx-NEWCO.

*****wa_datatab-col07 = wa_xxxxxx-AMOUNT.

*****wa_datatab-col08 = wa_xxxxxx-LOC_CURAMT.

*****wa_datatab-col09 = wa_xxxxxx-GL_TAXCD.

*****wa_datatab-col10 = wa_xxxxxx-GL_TAXJUR.

*****wa_datatab-col11 = wa_xxxxxx-AP_WH_BASE.

*****wa_datatab-col12 = wa_xxxxxx-AP_WH_EXMP.

*****wa_datatab-col13 = wa_xxxxxx-AP_WH_TXCD.

*****wa_datatab-col14 = wa_xxxxxx-GL_COSTCTR.

*****wa_datatab-col15 = wa_xxxxxx-GL_PROF_CT.

******wa_datatab-col16 =

*****wa_datatab-col17 = wa_xxxxxx-GL_ORDNO.

*****wa_datatab-col18 = wa_xxxxxx-GL_VALUEDT.

*****wa_datatab-col19 = wa_xxxxxx-AP_ALLOCNO.

*****wa_datatab-col20 = wa_xxxxxx-AP_TEXT.

*****wa_datatab-col21 = wa_xxxxxx-paymeth.

*****wa_datatab-col22 = wa_xxxxxx-AP_BASE_DT.

*****wa_datatab-col23 = wa_xxxxxx-GL_PURCHNO.

*****wa_datatab-col24 = wa_xxxxxx-GL_LINE_NO.

*****wa_datatab-col25 = wa_xxxxxx-GL_MATNO.

*****wa_datatab-col26 = wa_xxxxxx-GL_QUANT.

*****wa_datatab-col27 = wa_xxxxxx-GL_UOM.

*****wa_datatab-col28 = wa_xxxxxx-TRADE_PRTN.

*****wa_datatab-col29 = wa_xxxxxx-TRANS_TYPE.

*****wa_datatab-col30 = wa_xxxxxx-AP_PMSUP.

*****wa_datatab-col31 = wa_xxxxxx-GL_SERVNO.

*****wa_datatab-col32 = wa_xxxxxx-GL_REC_IND.

*****wa_datatab-col33 = wa_xxxxxx-AR_VENTURE.

*****wa_datatab-col34 = wa_xxxxxx-AR_EQ_GRP.

*****wa_datatab-col35 = wa_xxxxxx-AR_BIL_IND.

*****wa_datatab-col36 = wa_xxxxxx-GRP_CURAMT.

*****wa_datatab-col37 = wa_xxxxxx-ASSET_TRNS.

*****wa_datatab-col38 = wa_xxxxxx-AP_DSCBASE.

*****wa_datatab-col39 = wa_xxxxxx-AP_TAX_AMT.

*****wa_datatab-col40 = wa_xxxxxx-AP_DSC_AMT.

*****wa_datatab-col41 = wa_xxxxxx-GL_PLANT.

*****wa_datatab-col42 = wa_xxxxxx-AP_BUSAREA.

*****wa_datatab-col43 = wa_xxxxxx-AR_OPMON.

*****wa_datatab-col44 = wa_xxxxxx-AR_BILLMN.

*****wa_datatab-col45 = wa_xxxxxx-AP_TERMPAY.

******wa_datatab-col46 = wa_xxxxxx-COPA_SALES_ORG.

******wa_datatab-col47 = wa_xxxxxx-COPA_DIST_CHAN.

******wa_datatab-col48 = wa_xxxxxx-COPA_DIVISION.

******wa_datatab-col49 = wa_xxxxxx-COPA_PRODUCT.

******wa_datatab-col50 = wa_xxxxxx-COPA_PLANT.

******wa_datatab-col51 = wa_xxxxxx-COPA_LOCATION.

******wa_datatab-col52 = wa_xxxxxx-COPA_SHIP_TO.

******wa_datatab-col53 = wa_xxxxxx-COPA_SOLD_TO.

plz do me the favour.

useful answer will be awarded

thanks

Message was edited by:

bhanu

Message was edited by:

bhanu

alex_m
Active Contributor
0 Kudos

do mapping as AR-ARA,GL-GL,GL-AP,GL-AR,etc..

Get cleared from your functional people. No idea about AR-ARA,GL-GL,GL-AP,GL-AR,etc..

Former Member
0 Kudos

hi,

using "ALSM_EXCEL_TO_INTERNAL_TABLE" function module we can upload data from EXCEL to internal table. once u upload into internal table, u can update SAP accoring to requirement.

if this solutions is helpful assign the points then close the issue.

Regards,

Balu

Former Member
0 Kudos

use FM ALSM_EXCEL_TO_INTERNAL_TABLE to upload data to internal table which can be used to update data in SAP.

Also, it is not advisable to upload data directly into database. U need to write a BDC so that data gets updated correctly in SAP.