Advertisement
| 10.13.2008 at 08:27AM PDT, ID: 23809751 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: 193: 194: 195: 196: 197: 198: 199: 200: 201: 202: 203: 204: 205: 206: 207: 208: 209: 210: 211: 212: 213: 214: 215: 216: 217: 218: 219: 220: 221: 222: 223: 224: 225: 226: 227: 228: 229: 230: 231: 232: 233: 234: 235: 236: 237: 238: 239: 240: 241: 242: 243: 244: 245: 246: 247: 248: 249: 250: 251: 252: 253: 254: 255: 256: 257: 258: 259: 260: 261: 262: 263: 264: 265: 266: 267: 268: 269: 270: 271: 272: 273: 274: 275: 276: 277: 278: 279: 280: 281: 282: 283: 284: 285: 286: 287: 288: 289: 290: 291: 292: 293: 294: 295: 296: 297: 298: 299: 300: 301: 302: 303: 304: 305: 306: 307: 308: 309: 310: 311: 312: 313: 314: 315: 316: 317: 318: 319: 320: 321: 322: 323: 324: 325: 326: 327: 328: 329: 330: 331: 332: 333: 334: 335: 336: 337: 338: 339: 340: 341: 342: 343: 344: 345: 346: 347: 348: 349: 350: 351: 352: 353: 354: 355: 356: 357: 358: 359: 360: 361: 362: 363: 364: 365: 366: 367: 368: 369: 370: 371: 372: 373: 374: 375: 376: 377: 378: 379: 380: 381: 382: 383: 384: 385: 386: 387: 388: 389: 390: 391: 392: 393: 394: 395: 396: 397: 398: 399: 400: 401: 402: 403: 404: 405: 406: 407: 408: 409: 410: 411: 412: 413: 414: 415: 416: 417: 418: 419: 420: 421: 422: 423: 424: 425: 426: 427: 428: 429: 430: 431: 432: 433: 434: 435: 436: 437: 438: 439: 440: 441: 442: 443: 444: 445: 446: 447: 448: 449: 450: 451: 452: 453: 454: 455: 456: 457: 458: 459: 460: 461: 462: 463: 464: 465: 466: 467: 468: 469: 470: 471: 472: 473: 474: 475: 476: 477: 478: 479: 480: 481: 482: 483: 484: 485: 486: 487: 488: 489: 490: 491: 492: 493: 494: 495: 496: 497: 498: 499: 500: 501: 502: 503: 504: 505: 506: 507: 508: 509: 510: 511: 512: 513: 514: 515: 516: 517: 518: 519: 520: 521: 522: 523: 524: 525: 526: 527: 528: 529: 530: 531: 532: 533: 534: 535: 536: 537: 538: 539: 540: 541: 542: 543: 544: 545: 546: 547: 548: 549: 550: 551: 552: 553: 554: 555: 556: 557: 558: 559: 560: 561: 562: 563: 564: 565: 566: 567: 568: 569: 570: 571: 572: 573: 574: 575: 576: 577: 578: 579: 580: 581: 582: 583: 584: 585: 586: 587: 588: 589: 590: 591: 592: 593: 594: 595: 596: 597: 598: 599: 600: 601: 602: 603: 604: 605: 606: 607: 608: 609: 610: 611: 612: 613: 614: 615: 616: 617: 618: 619: 620: 621: 622: 623: 624: 625: 626: 627: 628: 629: 630: 631: 632: 633: 634: 635: 636: 637: 638: 639: 640: 641: 642: 643: 644: 645: 646: 647: 648: 649: 650: 651: 652: 653: 654: 655: 656: 657: 658: 659: 660: 661: 662: 663: 664: 665: 666: 667: 668: 669: 670: 671: 672: 673: 674: 675: 676: 677: 678: 679: 680: 681: 682: 683: 684: 685: 686: 687: 688: 689: 690: 691: 692: 693: 694: 695: 696: 697: 698: 699: 700: 701: 702: 703: 704: 705: 706: 707: 708: 709: 710: 711: 712: 713: 714: 715: 716: 717: 718: 719: 720: 721: 722: 723: 724: 725: 726: 727: 728: 729: 730: 731: 732: 733: 734: 735: 736: 737: 738: 739: 740: 741: 742: 743: 744: 745: 746: 747: 748: 749: 750: 751: 752: 753: 754: 755: 756: 757: 758: 759: 760: 761: 762: 763: 764: 765: 766: 767: 768: 769: 770: 771: 772: 773: 774: 775: 776: 777: 778: 779: 780: 781: 782: 783: 784: 785: 786: 787: 788: 789: 790: 791: 792: 793: 794: 795: 796: 797: 798: 799: 800: 801: 802: 803: 804: 805: 806: 807: 808: 809: 810: 811: 812: 813: 814: 815: 816: 817: 818: 819: 820: 821: 822: 823: 824: 825: 826: 827: 828: 829: 830: 831: 832: 833: 834: 835: 836: 837: 838: 839: 840: 841: 842: 843: 844: 845: 846: 847: 848: 849: 850: 851: 852: 853: 854: 855: 856: 857: 858: 859: 860: 861: 862: 863: 864: 865: 866: 867: 868: 869: 870: 871: 872: 873: 874: 875: 876: 877: 878: 879: 880: 881: 882: 883: 884: 885: 886: 887: 888: 889: 890: 891: 892: 893: 894: 895: 896: 897: 898: 899: 900: 901: 902: 903: 904: 905: 906: 907: 908: 909: 910: 911: 912: 913: 914: 915: 916: 917: 918: 919: 920: 921: 922: 923: 924: 925: 926: 927: 928: 929: 930: 931: 932: 933: 934: 935: 936: 937: 938: 939: 940: 941: 942: 943: 944: 945: 946: 947: 948: 949: 950: 951: 952: 953: 954: 955: 956: 957: 958: 959: 960: 961: 962: 963: 964: 965: 966: 967: 968: 969: 970: 971: |
Imports MySql.Data.MySqlClient
Imports System.Data
Imports Microsoft.VisualBasic
Partial Class SAPLoad
Inherits System.Web.UI.Page
'Header cells
Dim HeaderFlag, DocDate, PostDate, DocType, PerNum, CurrDesc, InvNum, HeaderText As String
'Detail cells
Dim PostingKey, AccountNum, SpecialLedger, CustNum, VendNum, Amount, CostCenter As String
Dim ProfitCenter, ValueDate, PayTerm, BaselineDate, AssignNum, ItemText, CreditControl, DiscountAmount, PayBlock As String
Dim PayMethod, WHTaxAmount, SpecialGL, HouseBank, CalcTaxFlag, TaxCode, Jurisdiction, SuccessFlag, PostDocNum, Code1099, WithholdTaxCode, InternalOrdNum, PlanningLevel, TradingPartner As String
Public Row As Integer
Public _cell(1600, 39) As String
Dim conn As MySqlConnection
Dim cmd As MySqlCommand
Dim da As MySqlDataAdapter
Public ds, ds2, ds3, ds4, ds5, ds6 As DataSet
Public strSql, strSql2, strSql3, strSql4, strSql5, strSql6 As String
Public acctmonth, acctyear, batchno, transactiontype As String
Public klBloc As Char
Public klBinv As System.Int64
Public AISRC, AISTAT As String
'Public PostingDate As String
Public i As Integer
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Client 120 Constants '
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Test for developer
Const SYSTEM = "DR3"
Const CLIENT = "120"
Const USER = "Batch_BAPI"
Const PASSWORD = "Bap1Temp"
Const LANGUAGE = "EN"
Const APPLICATION_SERVER = "10.1.1.127"
Const SYSTEM_NUMBER = "10"
Const HOST_NAME = "sansapxDEV01"
Const NO_DATA = "/"
'Test for user
'Const SYSTEM = "QR3"
'Const CLIENT = "210"
'Const USER = "Batch_BAPI"
'Const PASSWORD = "Bap1Temp"
'Const LANGUAGE = "EN"
'Const APPLICATION_SERVER = "10.1.1.175"
'Const SYSTEM_NUMBER = "00"
'Const HOST_NAME = "sansapxQAS01"
'Const NO_DATA = "/"
Dim CompNum As Integer
Dim LogonCtrl, LogonConn, FunctionCtrl, TableFactoryCtrl As Object
LogonCtrl = Server.CreateObject("SAP.LogonControl.1")
FunctionCtrl = Server.CreateObject("SAP.Functions")
TableFactoryCtrl = Server.CreateObject("SAP.TableFactory.1")
LogonConn = LogonCtrl.NewConnection()
LogonConn.System = SYSTEM
LogonConn.Client = CLIENT
LogonConn.User = USER
LogonConn.Password = PASSWORD
LogonConn.Language = LANGUAGE
LogonConn.ApplicationServer = APPLICATION_SERVER
LogonConn.SystemNumber = SYSTEM_NUMBER
LogonConn.HostName = HOST_NAME
If LogonConn.Logon(0, True) Then
Response.Write("R/3 Connection Success")
Else
Response.Write("R/3 Connection Failed")
Response.End()
End If
Response.Write("<br>")
FunctionCtrl.Connection = LogonConn
Dim ZFMD_FB01_BAPI, T_I_DTL, T_E_MSG, E_TOT, E_FTOT, E_SUBRC, I_NODATA As Object
ZFMD_FB01_BAPI = FunctionCtrl.Add("ZFMD_FB01_BAPI")
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Assign Table, Import, and Export properties to collection '
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
T_I_DTL = ZFMD_FB01_BAPI.Tables("T_I_DTL")
T_E_MSG = ZFMD_FB01_BAPI.Tables("T_E_MSG")
I_NODATA = ZFMD_FB01_BAPI.Exports("I_NODATA")
E_TOT = ZFMD_FB01_BAPI.Imports("E_TOT")
E_FTOT = ZFMD_FB01_BAPI.Imports("E_FTOT")
E_SUBRC = ZFMD_FB01_BAPI.Imports("E_SUBRC")
I_NODATA.Value = "/"
Dim objWeb, objTTFix As Object
transactiontype = Request.QueryString("transactiontype")
acctmonth = Request.QueryString("acctmonth")
acctyear = Request.QueryString("acctyear")
batchno = Request.QueryString("batchno")
conn = New MySqlConnection(ConfigurationManager.AppSettings("MyConnectionString"))
conn.Open()
strSql = "Select * from invoiceheaderfile where AccountingDateYear='" & acctyear & "' and AccountingDateMonth='" & acctmonth & "' and SourceCode='1' and BatchNumber='" & batchno & "'"
cmd = New MySqlCommand(strSql, conn)
da = New MySqlDataAdapter(cmd)
ds = New DataSet()
da.Fill(ds)
'PostingDate = Date.Now.Month & "/" & Date.Now.Day & "/" & Date.Now.Year
Row = 0
For i = 0 To ds.Tables(0).Rows.Count - 1
AISRC = ds.Tables(0).Rows(i)("SourceCode")
AISTAT = ds.Tables(0).Rows(i)("RcdStatus")
If (AISRC = "1" And AISTAT <> "P") Then
klBloc = ds.Tables(0).Rows(i)("location")
klBinv = ds.Tables(0).Rows(i)("VoucherInvoiceNo") '?????? VoucherInvoiceNo or VendorInvoiceNo?????Mark
' Get Company Number
strSql6 = "Select * from truckticketdetail where InvoiceNumber='" & ds.Tables(0).Rows(i)("VendorInvoiceNo") & "'"
cmd = New MySqlCommand(strSql6, conn)
da = New MySqlDataAdapter(cmd)
ds6 = New DataSet()
da.Fill(ds6)
Try
CompNum = ds6.Tables(0).Rows(0)("CostCompany")
Catch ex As Exception
CompNum = 0
End Try
If klBloc.ToString.Contains("") = False Then
strSql3 = "Select * from apdetaillines where AccountingYear=" & acctyear & " and AccountingMonth=" & acctmonth & " and SourceCode=1 and BatchNo=" & batchno & " and Location='" & klBloc & "' and InvoiceNo=" & klBinv
Else
strSql3 = "Select * from apdetaillines where AccountingYear=" & acctyear & " and AccountingMonth=" & acctmonth & " and SourceCode=1 and BatchNo=" & batchno & " and InvoiceNo=" & klBinv
End If
cmd = New MySqlCommand(strSql3, conn)
da = New MySqlDataAdapter(cmd)
ds3 = New DataSet()
da.Fill(ds3)
HeaderFlag = "X"
DocDate = Format(ds.Tables(0).Rows(i)("InvoiceDateMonth"), "00") & "/" & Format(ds.Tables(0).Rows(i)("InvoiceDateDay"), "00") & "/" & ds.Tables(0).Rows(i)("InvoiceDateYear")
PostDate = Format(Date.Now.Month, "00") & "/" & Format(Date.Now.Day, "00") & "/" & Date.Now.Year
DocType = "Z3"
PerNum = "/"
CurrDesc = "USD"
InvNum = ds.Tables(0).Rows(i)("VendorInvoiceNo")
HeaderText = "Truck Tickets"
PostingKey = "/"
AccountNum = "/"
SpecialLedger = "/"
transactiontype = "/"
CustNum = "/"
VendNum = "/"
Amount = "0000000000000"
CostCenter = "/"
ProfitCenter = "/"
ValueDate = "/"
PayTerm = "0001"
BaselineDate = "/"
AssignNum = "/"
ItemText = "/"
CreditControl = "/"
DiscountAmount = "0000000000000"
PayBlock = "/"
PayMethod = "/"
WHTaxAmount = "0000000000000"
SpecialGL = "/"
HouseBank = "/"
CalcTaxFlag = "/"
TaxCode = "/"
Jurisdiction = "/"
WithholdTaxCode = "/"
InternalOrdNum = "/"
PlanningLevel = "/"
TradingPartner = "/"
SuccessFlag = "/"
PostDocNum = "/"
'/* Header Flag *'/
_cell(Row, 1) = HeaderFlag
'/* Doc Date *'/
_cell(Row, 2) = DocDate
'/* Post Date *'/
_cell(Row, 3) = PostDate
'/* Doc Type *'/
_cell(Row, 4) = DocType
'/* CompNum *'/
_cell(Row, 5) = CompNum
'/* Period Num *'/
_cell(Row, 6) = PerNum
'/* CurrDesc *'/
_cell(Row, 7) = CurrDesc
'/'/ InvNum
_cell(Row, 8) = InvNum
'/'/ Header Text
_cell(Row, 9) = HeaderText
'/'/ Posting Key
_cell(Row, 10) = PostingKey
'/'/ Account Number
_cell(Row, 11) = AccountNum
'/'/ Special Ledger
_cell(Row, 12) = SpecialLedger
'/'/ Transaction Type
_cell(Row, 13) = transactiontype
'/'/ Cust Num
_cell(Row, 14) = CustNum
'/'/ Vendor Num
_cell(Row, 15) = VendNum
'/'/ Amount
_cell(Row, 16) = Amount
'/'/ Cost Center
_cell(Row, 17) = CostCenter
'/'/ Profit Center
_cell(Row, 18) = ProfitCenter
'/'/ Value Date
_cell(Row, 19) = ValueDate
'/'/ Pay Terms
_cell(Row, 20) = PayTerm
'/'/ Baseline Date
_cell(Row, 21) = BaselineDate
'/'/ AssignNum
_cell(Row, 22) = AssignNum
'/'/ Item Text
_cell(Row, 23) = ItemText
'/'/ CreditControl
_cell(Row, 24) = CreditControl
'/'/ DiscountAmount
_cell(Row, 25) = DiscountAmount
'/'/ PayBlock
_cell(Row, 26) = PayBlock
'/'/ PayMethod
_cell(Row, 27) = PayMethod
'/'/ WHTaxAmount
_cell(Row, 28) = WHTaxAmount
'/'/ HouseBank
_cell(Row, 29) = HouseBank
'/'/ SpecialGL
_cell(Row, 30) = SpecialGL
'/'/ CalcTaxFlag
_cell(Row, 31) = CalcTaxFlag
'/'/ TaxCode
_cell(Row, 32) = TaxCode
'/'/ Jurisdiction
_cell(Row, 33) = Jurisdiction
'/'/ Withholding TaxCode
_cell(Row, 34) = WithholdTaxCode
'/'/ Internal Order Number
_cell(Row, 35) = InternalOrdNum
'/'/ Planning Level
_cell(Row, 36) = PlanningLevel
'/'/ Trading Partner
_cell(Row, 37) = TradingPartner
'/'/ SuccessFlag
_cell(Row, 38) = SuccessFlag
'/'/ PostDocNum
_cell(Row, 39) = PostDocNum
GetDetail()
GetOffset()
strSql2 = "Update invoiceheaderfile set RcdStatus='P' "
cmd = New MySqlCommand(strSql2, conn)
da = New MySqlDataAdapter(cmd)
ds2 = New DataSet()
da.Fill(ds2)
End If
Row = Row + 1
Next
Row = 0
Response.Write("<table class=border1 width=4000 border>" & vbCr)
Do Until Len(_cell(CInt(Row), 1)) = 0 And Len(_cell(CInt(Row), 10)) = 0
T_I_DTL.AppendRow()
T_I_DTL.Value(Row + 1, "HD_HEAD_X") = _cell(CInt(Row), 1)
T_I_DTL.Value(Row + 1, "HD_DOCDAT") = _cell(CInt(Row), 2)
T_I_DTL.Value(Row + 1, "HD_PSTDAT") = _cell(CInt(Row), 3)
T_I_DTL.Value(Row + 1, "HD_DOCTYP") = _cell(CInt(Row), 4)
T_I_DTL.Value(Row + 1, "HD_NACONO") = _cell(CInt(Row), 5)
T_I_DTL.Value(Row + 1, "HD_PERIOD") = _cell(CInt(Row), 6)
T_I_DTL.Value(Row + 1, "HD_CRRNCY") = _cell(CInt(Row), 7)
T_I_DTL.Value(Row + 1, "HD_RFRNCE") = _cell(CInt(Row), 8)
T_I_DTL.Value(Row + 1, "HD_HEADTX") = _cell(CInt(Row), 9)
T_I_DTL.Value(Row + 1, "IT_PSTKEY") = _cell(CInt(Row), 10)
T_I_DTL.Value(Row + 1, "IT_NAACCT") = _cell(CInt(Row), 11)
T_I_DTL.Value(Row + 1, "IT_PSTLET") = _cell(CInt(Row), 12)
T_I_DTL.Value(Row + 1, "IT_TRNSTY") = _cell(CInt(Row), 13)
T_I_DTL.Value(Row + 1, "IT_CUSTNR") = _cell(CInt(Row), 14)
T_I_DTL.Value(Row + 1, "IT_VENDNR") = _cell(CInt(Row), 15)
T_I_DTL.Value(Row + 1, "IT_AMOUNT") = _cell(CInt(Row), 16)
T_I_DTL.Value(Row + 1, "IT_COSTCT") = _cell(CInt(Row), 17)
T_I_DTL.Value(Row + 1, "IT_PROFCT") = _cell(CInt(Row), 18)
T_I_DTL.Value(Row + 1, "IT_VALDAT") = _cell(CInt(Row), 19)
T_I_DTL.Value(Row + 1, "IT_PAYTRM") = _cell(CInt(Row), 20)
T_I_DTL.Value(Row + 1, "IT_BASDAT") = _cell(CInt(Row), 21)
T_I_DTL.Value(Row + 1, "IT_ASSGTX") = _cell(CInt(Row), 22)
T_I_DTL.Value(Row + 1, "IT_FREETX") = _cell(CInt(Row), 23)
T_I_DTL.Value(Row + 1, "IT_CRDCTL") = _cell(CInt(Row), 24)
T_I_DTL.Value(Row + 1, "IT_DISCNT") = _cell(CInt(Row), 25)
T_I_DTL.Value(Row + 1, "IT_PAYBLK") = _cell(CInt(Row), 26)
T_I_DTL.Value(Row + 1, "IT_PAYMTH") = _cell(CInt(Row), 27)
T_I_DTL.Value(Row + 1, "IT_TAXAMT") = _cell(CInt(Row), 28)
T_I_DTL.Value(Row + 1, "IT_HSBANK") = _cell(CInt(Row), 29)
T_I_DTL.Value(Row + 1, "IT_SPASSN") = _cell(CInt(Row), 30)
T_I_DTL.Value(Row + 1, "IT_CALCTX") = _cell(CInt(Row), 31)
T_I_DTL.Value(Row + 1, "IT_TAXCOD") = _cell(CInt(Row), 32)
T_I_DTL.Value(Row + 1, "IT_JURCOD") = _cell(CInt(Row), 33)
T_I_DTL.Value(Row + 1, "IT_WTAXCD") = _cell(CInt(Row), 34)
T_I_DTL.Value(Row + 1, "IT_INTORD") = _cell(CInt(Row), 35)
T_I_DTL.Value(Row + 1, "IT_PLNLEV") = _cell(CInt(Row), 36)
T_I_DTL.Value(Row + 1, "IT_TRDPTR") = _cell(CInt(Row), 37)
T_I_DTL.Value(Row + 1, "LG_SUCCFL") = _cell(CInt(Row), 38)
T_I_DTL.Value(Row + 1, "LG_DOCUNR") = _cell(CInt(Row), 39)
'If _cell(CInt(Row), 1) = "X" Then
' Response.Write("Record = ")
'Else
' Response.Write("Line = ")
'End If
'Response.Write(_cell(CInt(Row), 1))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 2))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 3))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 4))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 5))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 6))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 7))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 8))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 9))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 10))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 1))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 11))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 12))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 13))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 14))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 15))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 16))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 17))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 18))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 19))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 20))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 21))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 22))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 23))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 24))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 25))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 26))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 27))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 28))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 29))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 30))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 31))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 32))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 33))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 34))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 35))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 36))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 37))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 38))
'Response.Write(" ,")
'Response.Write(_cell(CInt(Row), 39))
'Response.Write("<BR>")
'Row = CInt(Row) + 1
Loop
Response.Write("</table>" & vbCr)
Response.Write("<br>" & vbCr)
objTTFix = Nothing
objWeb = Nothing
ZFMD_FB01_BAPI.Call()
Response.Write("<table class=border1>" & vbCr)
Response.Write("<col width=50>" & vbCr)
Response.Write("<col width=50>" & vbCr)
Response.Write("<col width=50>" & vbCr)
Response.Write("<col width=80>" & vbCr)
Response.Write("<col width=50>" & vbCr)
Response.Write("<col width=50>" & vbCr)
Response.Write("<col width=50>" & vbCr)
Response.Write("<col width=225>" & vbCr)
Response.Write("<col width=50>" & vbCr)
Response.Write("<col width=50>" & vbCr)
Response.Write("<col width=50>" & vbCr)
Response.Write("<col width=80>" & vbCr)
Response.Write("<col width=80>" & vbCr)
Response.Write("<col width=50>" & vbCr)
Response.Write("<col width=50>" & vbCr)
Response.Write("<col width=225>" & vbCr)
Response.Write("<th title='SAP Message Type'> MSGTY1</th>" & vbCr)
Response.Write("<th title='Message Identification'>MSGID1</th>" & vbCr)
Response.Write("<th title='Message Number'> MSGNR1</th>" & vbCr)
Response.Write("<th title='Message Variable 01'> MSGV11</th>" & vbCr)
Response.Write("<th title='Message Variable 02'> MSGV21</th>" & vbCr)
Response.Write("<th title='Message Variable 03'> MSGV31</th>" & vbCr)
Response.Write("<th title='Message Variable 04'> MSGV41</th>" & vbCr)
Response.Write("<th title='Text 255 Characters'> MSGTX1</th>" & vbCr)
Response.Write("<th title='SAP Message Type'> MSGTY2</th>" & vbCr)
Response.Write("<th title='Message Identification'>MSGID2</th>" & vbCr)
Response.Write("<th title='Message Number'> MSGNR2</th>" & vbCr)
Response.Write("<th title='Message Variable 01'> MSGV12</th>" & vbCr)
Response.Write("<th title='Message Variable 02'> MSGV22</th>" & vbCr)
Response.Write("<th title='Message Variable 03'> MSGV32</th>" & vbCr)
Response.Write("<th title='Message Variable 04'> MSGV42</th>" & vbCr)
Response.Write("<th title='Text 255 Characters'> MSGTX2</th>" & vbCr)
Dim Counter
For Counter = 1 To T_E_MSG.RowCount
Response.Write("<tr>" & vbCr)
Response.Write("<td>" & T_E_MSG.Cell(Counter, "MSGTY1") & "</td>" & vbCr)
Response.Write("<td>" & T_E_MSG.Cell(Counter, "MSGID1") & "</td>" & vbCr)
Response.Write("<td>" & T_E_MSG.Cell(Counter, "MSGNR1") & "</td>" & vbCr)
Response.Write("<td>" & T_E_MSG.Cell(Counter, "MSGV11") & "</td>" & vbCr)
Response.Write("<td>" & T_E_MSG.Cell(Counter, "MSGV21") & "</td>" & vbCr)
Response.Write("<td>" & T_E_MSG.Cell(Counter, "MSGV31") & "</td>" & vbCr)
Response.Write("<td>" & T_E_MSG.Cell(Counter, "MSGV41") & "</td>" & vbCr)
Response.Write("<td>" & T_E_MSG.Cell(Counter, "MSGTX1") & "</td>" & vbCr)
Response.Write("<td>" & T_E_MSG.Cell(Counter, "MSGTY2") & "</td>" & vbCr)
Response.Write("<td>" & T_E_MSG.Cell(Counter, "MSGID2") & "</td>" & vbCr)
Response.Write("<td>" & T_E_MSG.Cell(Counter, "MSGNR2") & "</td>" & vbCr)
Response.Write("<td>" & T_E_MSG.Cell(Counter, "MSGV12") & "</td>" & vbCr)
Response.Write("<td>" & T_E_MSG.Cell(Counter, "MSGV22") & "</td>" & vbCr)
Response.Write("<td>" & T_E_MSG.Cell(Counter, "MSGV32") & "</td>" & vbCr)
Response.Write("<td>" & T_E_MSG.Cell(Counter, "MSGV42") & "</td>" & vbCr)
Response.Write("<td>" & T_E_MSG.Cell(Counter, "MSGTX2") & "</td>" & vbCr)
Response.Write("</tr>" & vbCr)
Next
Response.Write("</table>")
LogonConn.Logoff()
End Sub
Private Sub GetOffset()
Dim CompNum As Integer
CompNum = ds6.Tables(0).Rows(0)("CostCompany")
Dim GenNumber As Integer
HeaderFlag = "/"
DocDate = "/"
PostDate = "/"
DocType = "/"
PerNum = "/"
CurrDesc = "/"
InvNum = "/"
HeaderText = "/"
PostingKey = "31"
AccountNum = "/"
GenNumber = ds.Tables(0).Rows(i)("OffsetAccountNo")
SpecialLedger = "/"
transactiontype = "/"
CustNum = "/"
strSql5 = "Select NewVendorNumber from mslnamev where CompanyNumber=" & ds.Tables(0).Rows(i)("CompanyNumber") & " and NANumber=" & ds.Tables(0).Rows(i)("VendorNumber")
cmd = New MySqlCommand(strSql5, conn)
da = New MySqlDataAdapter(cmd)
ds5 = New DataSet()
da.Fill(ds5)
Try
VendNum = ds5.Tables(0).Rows(0)("NewVendorNumber")
Catch ex As Exception
VendNum = 0
End Try
Amount = ds.Tables(0).Rows(i)("GrossInvoiceAmount")
CostCenter = "/"
ProfitCenter = "/"
ValueDate = "/"
PayTerm = "0001"
AssignNum = "/"
ItemText = ds.Tables(0).Rows(i)("InvoiceDescription")
CreditControl = "/"
DiscountAmount = "0000000000000"
PayBlock = "/"
PayMethod = "/"
' PayMethod = "C"
WHTaxAmount = "0000000000000"
SpecialGL = "/"
HouseBank = "/"
CalcTaxFlag = "/"
TaxCode = "/"
Jurisdiction = "/"
WithholdTaxCode = "/"
InternalOrdNum = "/"
PlanningLevel = "/"
TradingPartner = "/"
SuccessFlag = "/"
PostDocNum = "/"
Row = Row + 1
'/'/ Header Flag '/'/
_cell(Row, 1) = HeaderFlag
'/'/ Doc Date '/'/
_cell(Row, 2) = DocDate
'/'/ Post Date '/'/
_cell(Row, 3) = PostDate
'/'/ Doc Type '/'/
_cell(Row, 4) = DocType
'/'/ CompNum '/'/
_cell(Row, 5) = CompNum
'/'/ Period Num '/'/
_cell(Row, 6) = PerNum
'/'/ CurrDesc '/'/
_cell(Row, 7) = CurrDesc
'/'/ InvNum '/'/
_cell(Row, 8) = InvNum
'/'/ Header Text '/'/
_cell(Row, 9) = HeaderText
'/'/ Posting Key '/'/
_cell(Row, 10) = PostingKey
'/'/ Account Number '/'/
_cell(Row, 11) = AccountNum
'/'/ Special Ledger '/'/
_cell(Row, 12) = SpecialLedger
'/'/ Transaction Type '/'/
_cell(Row, 13) = transactiontype
'/'/ Cust Num '/'/
_cell(Row, 14) = CustNum
'/'/ Vendor Num '/'/
_cell(Row, 15) = VendNum
'/'/ Amount '/'/
_cell(Row, 16) = Amount
'/'/ Cost Center '/'/
_cell(Row, 17) = CostCenter
'/'/ Profit Center '/'/
_cell(Row, 18) = ProfitCenter
'/'/ Value Date '/'/
_cell(Row, 19) = ValueDate
'/'/ Pay Terms '/'/
_cell(Row, 20) = PayTerm
'/'/ Baseline Date '/'/
_cell(Row, 21) = BaselineDate
'/'/ AssignNum '/'/
_cell(Row, 22) = AssignNum
'/'/ Item Text '/'/
_cell(Row, 23) = ItemText
'/'/ CreditControl '/'/
_cell(Row, 24) = CreditControl
'/'/ DiscountAmount '/'/
_cell(Row, 25) = DiscountAmount
'/'/ PayBlock '/'/
_cell(Row, 26) = PayBlock
'/'/ PayMethod '/'/
_cell(Row, 27) = PayMethod
'/'/ WHTaxAmount '/'/
_cell(Row, 28) = WHTaxAmount
'/'/ HouseBank '/'/
_cell(Row, 29) = HouseBank
'/'/ SpecialGL '/'/
_cell(Row, 30) = SpecialGL
'/'/ CalcTaxFlag '/'/
_cell(Row, 31) = CalcTaxFlag
'/'/ TaxCode '/'/
_cell(Row, 32) = TaxCode
'/'/ Jurisdiction '/'/
_cell(Row, 33) = Jurisdiction
'/'/ Withholding TaxCode '/'/
_cell(Row, 34) = WithholdTaxCode
'/'/ Internal Order Number '/'/
_cell(Row, 35) = InternalOrdNum
'/'/ Planning Level '/'/
_cell(Row, 36) = PlanningLevel
'/'/ Trading Partner '/'/
_cell(Row, 37) = TradingPartner
'/'/ SuccessFlag '/'/
_cell(Row, 38) = SuccessFlag
'/'/ PostDocNum '/'/
_cell(Row, 39) = PostDocNum
End Sub
Private Sub GetDetail()
Dim count As Integer
Dim CompNum As String
Dim GenNumber, SubNumber As String
HeaderFlag = "/"
DocDate = "/"
PostDate = "/"
DocType = "/"
CompNum = "/"
PerNum = "/"
CurrDesc = "/"
InvNum = "/"
HeaderText = "/"
PostingKey = "40"
GenNumber = ds3.Tables(0).Rows(0)("InvoiceLineAcctNoGen")
SubNumber = ds3.Tables(0).Rows(0)("InvoiceLineAcctNoSub")
AccountNum = GenNumber & SubNumber
SpecialLedger = "/"
transactiontype = "/"
CustNum = "/"
VendNum = "/"
Amount = ds3.Tables(0).Rows(0)("LineGrossAmount")
CostCenter = " "
If (GenNumber >= "001" And GenNumber <= "299") Then
strSql4 = "Select YCOSTC from glp0022w where XCONO=" & ds6.Tables(0).Rows(0)("CostCompany") & " AND XDIV=" & ds6.Tables(0).Rows(0)("CostDivision")
End If
If (GenNumber >= "300" And GenNumber <= "499") Then
strSql4 = "Select YCOSTC from glp0022x where XCONO=" & ds6.Tables(0).Rows(0)("CostCompany") & " AND XDIV=" & ds6.Tables(0).Rows(0)("CostDivision")
End If
If (GenNumber >= "500" And GenNumber <= "999") Then
strSql4 = "Select YCOSTC from glp0022y where XCONO=" & ds6.Tables(0).Rows(0)("CostCompany") & " AND XDIV=" & ds6.Tables(0).Rows(0)("CostDivision")
End If
If strSql4 <> "" Then
cmd = New MySqlCommand(strSql4, conn)
da = New MySqlDataAdapter(cmd)
ds4 = New DataSet()
da.Fill(ds4)
count = ds4.Tables.Count
If count = 1 Then
CostCenter = ds4.Tables(0).Rows(0)("YCOSTC")
Else
strSql4 = ""
ds4 = Nothing
strSql4 = "Select YCOSTC from glp0022y where XCONO=" & ds6.Tables(0).Rows(0)("CostCompany") & " AND XDIV=" & ds6.Tables(0).Rows(i)("CostDivision") & " AND XDEPT=" & ds.Tables(0).Rows(i)("CostDepartment")
cmd = New MySqlCommand(strSql4, conn)
da = New MySqlDataAdapter(cmd)
ds4 = New DataSet()
da.Fill(ds4)
CostCenter = ds4.Tables(0).Rows(0)("YCOSTC")
End If
End If
ProfitCenter = "/"
ValueDate = "/"
PayTerm = "0001"
BaselineDate = "/"
AssignNum = "/"
ItemText = ds3.Tables(0).Rows(0)("LineDesc")
CreditControl = "/"
DiscountAmount = "0000000000000"
PayBlock = "/"
PayMethod = "/"
WHTaxAmount = "0000000000000"
SpecialGL = "/"
HouseBank = "/"
CalcTaxFlag = "/"
TaxCode = "/"
Jurisdiction = "/"
WithholdTaxCode = "/"
InternalOrdNum = "/"
PlanningLevel = "/"
TradingPartner = "/"
SuccessFlag = "/"
PostDocNum = "/"
Row = Row + 1
'/******************************************'/
'/'/ Header Flag '/'/
'/******************************************'/
_cell(Row, 1) = HeaderFlag
'/******************************************'/
'/'/ Doc Date '/'/
'/******************************************'/
_cell(Row, 2) = DocDate
'/******************************************'/
'/'/ Post Date '/'/
'/******************************************'/
_cell(Row, 3) = PostDate
'/******************************************'/
'/'/ Doc Type '/'/
'/******************************************'/
_cell(Row, 4) = DocType
'/******************************************'/
'/'/ CompNum '/'/
'/******************************************'/
_cell(Row, 5) = CompNum
'/******************************************'/
'/'/ Perjod Num '/'/
'/******************************************'/
_cell(Row, 6) = PerNum
'/******************************************'/
'/'/ CurrDesc '/'/
'/******************************************'/
_cell(Row, 7) = CurrDesc
'/******************************************'/
'/'/ jnvNum '/'/
'/******************************************'/
_cell(Row, 8) = InvNum
'/******************************************'/
'/'/ Header Text '/'/
'/******************************************'/
_cell(Row, 9) = HeaderText
'/******************************************'/
'/'/ Postjng Key '/'/
'/******************************************'/
_cell(Row, 10) = PostingKey
'/******************************************'/
'/'/ Account Number '/'/
'/******************************************'/
_cell(Row, 11) = AccountNum
'/******************************************'/
'/'/ Specjal Ledger '/'/
'/******************************************'/
_cell(Row, 12) = SpecialLedger
'/******************************************'/
'/'/ Transactjon Type '/'/
'/******************************************'/
_cell(Row, 13) = transactiontype
'/******************************************'/
'/'/ Cust Num '/'/
'/******************************************'/
_cell(Row, 14) = CustNum
'/******************************************'/
'/'/ Vendor Num '/'/
'/******************************************'/
_cell(Row, 15) = VendNum
'/******************************************'/
'/'/ Amount '/'/
'/******************************************'/
_cell(Row, 16) = Amount
'/******************************************'/
'/'/ Cost Center '/'/
'/******************************************'/
_cell(Row, 17) = CostCenter
'/******************************************'/
'/'/ Profjt Center '/'/
'/******************************************'/
_cell(Row, 18) = ProfitCenter
'/******************************************'/
'/'/ Value Date '/'/
'/******************************************'/
_cell(Row, 19) = ValueDate
'/******************************************'/
'/'/ Pay Terms '/'/
'/******************************************'/
_cell(Row, 20) = PayTerm
'/******************************************'/
'/'/ Baseljne Date '/'/
'/******************************************'/
_cell(Row, 21) = BaselineDate
'/******************************************'/
'/'/ AssjgnNum '/'/
'/******************************************'/
_cell(Row, 22) = AssignNum
'/******************************************'/
'/'/ jtem Text '/'/
'/******************************************'/
_cell(Row, 23) = ItemText
'/******************************************'/
'/'/ CredjtControl '/'/
'/******************************************'/
_cell(Row, 24) = CreditControl
'/******************************************'/
'/'/ DjscountAmount '/'/
'/******************************************'/
_cell(Row, 25) = DiscountAmount
'/******************************************'/
'/'/ PayBlock '/'/
'/******************************************'/
_cell(Row, 26) = PayBlock
'/******************************************'/
'/'/ PayMethod '/'/
'/******************************************'/
_cell(Row, 27) = PayMethod
'/******************************************'/
'/'/ WHTaxAmount '/'/
'/******************************************'/
_cell(Row, 28) = WHTaxAmount
'/******************************************'/
'/'/ HouseBank '/'/
'/******************************************'/
_cell(Row, 29) = HouseBank
'/******************************************'/
'/'/ SpecjalGL '/'/
'/******************************************'/
_cell(Row, 30) = SpecialGL
'/******************************************'/
'/'/ CalcTaxFlag '/'/
'/******************************************'/
_cell(Row, 31) = CalcTaxFlag
'/******************************************'/
'/'/ TaxCode '/'/
'/******************************************'/
_cell(Row, 32) = TaxCode
'/******************************************'/
'/'/ Jurjsdjctjon '/'/
'/******************************************'/
_cell(Row, 33) = Jurisdiction
'/******************************************'/
'/'/ Wjthholdjng TaxCode '/'/
'/******************************************'/
_cell(Row, 34) = WithholdTaxCode
'/******************************************'/
'/'/ jnternal Order Number '/'/
'/******************************************'/
_cell(Row, 35) = InternalOrdNum
'/******************************************'/
'/'/ Planning Level '/'/
'/******************************************'/
_cell(Row, 36) = PlanningLevel
'/******************************************'/
'/'/ Tradjng Partner '/'/
'/******************************************'/
_cell(Row, 37) = TradingPartner
'/******************************************'/
'/'/ SuccessFlag '/'/
'/******************************************'/
_cell(Row, 38) = SuccessFlag
'/******************************************'/
'/'/ PostDocNum '/'/
'/******************************************'/
_cell(Row, 39) = PostDocNum
End Sub
End Class
|
Advertisement