// // SAP-Create-BDC-Data.vdm Christian Ziemski 14.01.2004 // // // Uses the generated SAP-BDC-Data definition e.g. // // data: begin of record, // * data element: MATKL // MATKL_001(009), // * data element: // UPPER_LIMIT_02_002(120), // end of record. // // to create a format string in TReg-0 containing spaces and on every field begin a "|". // The format string is ended with a trailing "<<" (outside of the data!!) // // This can be used to format a TAB-delimetd datafile to be formated via the Ctrl-Q function. // Here is that key assignment for reference: // // Ctrl-Q [VISUAL EXIT] Save_Pos() #103=CL #104=0 OR(103) BoL Repeat(ALL){ if(CC=='"'){S('"', ADVANCE+NOERR+COUNT, 2)} DoV("\NW\") if(CL==#103 && (!At_EoL)){#105=Cur_Col if(#105>255){break} NT(#105,NOCR) #104+=1 if(#104>32){break}}else{break}} OR(CLEAR) if(#104>0){if(#104==1){OR(103) NT(#105,NOCR) NT(#105, NOCR) OR(CLEAR)} RS(103,"Config_Tab(", INSERT) RS(103,")",APPEND) Call(103)} Restore_Pos() // // Attention: Since the above Ctrl-Q function relies on "words" in the // formatting line, one-character-fields can't be done without manual interaction! // // Todo: Modification regarding enhanced TAB-ranges as of 6.12.1 // // Reg_Empty(103) #103=0 #104=0 BoF while (! At_EoF) { Search("|<* data element:", NOERR+ERRBREAK) if (#103 > 0) { Out_Reg(103, APPEND) Type_Char(124) // "|" Out_Reg(CLEAR) #104=1 } Line(1) Search_Block("(", Cur_Pos, EoL_Pos, ADVANCE+NOERR+ERRBREAK) #103=Num_Eval(SUPPRESS) Out_Reg(103, APPEND) Type_Char(32, COUNT, #103-#104) Out_Reg(CLEAR) Line(1, NOERR) } Reg_Set(103, "<<", APPEND) Reg_Set(0, @103)